We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7d2468b commit 802e6c3Copy full SHA for 802e6c3
tests/QueryBuilderTest.php
@@ -413,4 +413,18 @@ public function testUnset()
413
$this->assertFalse(isset($user2['note2']));
414
}
415
416
+ public function testUpdateSubdocument()
417
+ {
418
+ DB::collection('users')->insertGetId(array(
419
+ 'name' => 'John Doe',
420
+ 'address' => array('country' => 'Belgium')
421
+ ));
422
+
423
+ DB::collection('users')->where('name', 'John Doe')->update(array('address.country' => 'England'));
424
425
+ $check = DB::collection('users')->where('name', 'John Doe')->first();
426
427
+ $this->assertEquals('England', $check['address']['country']);
428
+ }
429
430
0 commit comments