Skip to content

Commit 0ebad3e

Browse files
committed
wip:
1 parent 151bbaa commit 0ebad3e

File tree

2 files changed

+13
-12
lines changed

2 files changed

+13
-12
lines changed

docs/includes/usage-examples/FindOneTest.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,16 @@ public function testFindOne(): void
3434
// end-eloquent-find-one
3535

3636
$this->assertInstanceOf(Movie::class, $movie);
37-
$this->assertSame($movie->title, 'The Shawshank Redemption');
38-
37+
3938
// begin-qb-find-one
4039
$movie = DB::table('movies')
4140
->where('directors', 'Rob Reiner')
4241
->orderBy('_id')
4342
->first();
4443

45-
echo print_r($movie);
44+
echo $movie['title'];
4645
// end-qb-find-one
46+
47+
$this->assertSame($movie['title'], 'The Shawshank Redemption');
4748
}
4849
}

docs/includes/usage-examples/UpdateOneTest.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -47,15 +47,15 @@ public function testUpdateOne(): void
4747

4848
// begin-qb-update-one
4949
$updates = DB::table('movies')
50-
->where('title', 'Carol')
51-
->orderBy('_id')
52-
->first()
53-
->update([
54-
'imdb' => [
55-
'rating' => 7.3,
56-
'votes' => 142000,
57-
],
58-
]);
50+
->updateOne(
51+
['title' => 'Carol'],
52+
['$set' => [
53+
'imdb' => [
54+
'rating' => 7.3,
55+
'votes' => 142000,
56+
],
57+
]]
58+
);
5959

6060
echo 'Updated documents: ' . $updates;
6161
// end-qb-update-one

0 commit comments

Comments
 (0)