Skip to content

Commit 6b763fb

Browse files
committed
Merge pull request #381
2 parents 2d2f443 + 8973ac2 commit 6b763fb

File tree

4 files changed

+68
-50
lines changed

4 files changed

+68
-50
lines changed

docs/reference/method/MongoDBCollection-findOne.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ special BSON type, the query criteria for selecting a restaurant must use the
6868

6969
$restaurant = $database->restaurants->findOne([
7070
'_id' => new MongoDB\BSON\ObjectID('594d5ef280a846852a4b3f70'),
71-
])
71+
]);
7272

7373
Projecting Fields
7474
~~~~~~~~~~~~~~~~~

docs/reference/method/MongoDBCollection-findOneAndDelete.txt

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -75,18 +75,21 @@ The following example finds and deletes the document with ``restaurant_id`` of
7575

7676
The output would then resemble::
7777

78-
object(stdClass)#14 (4) {
79-
["_id"]=>
80-
object(MongoDB\BSON\ObjectID)#11 (1) {
81-
["oid"]=>
82-
string(24) "576023c6b02fa9281da3fad9"
78+
object(MongoDB\Model\BSONDocument)#17 (1) {
79+
["storage":"ArrayObject":private]=>
80+
array(4) {
81+
["_id"]=>
82+
object(MongoDB\BSON\ObjectID)#11 (1) {
83+
["oid"]=>
84+
string(24) "594d5ef280a846852a4b3f70"
85+
}
86+
["borough"]=>
87+
string(9) "Manhattan"
88+
["name"]=>
89+
string(15) "Agra Restaurant"
90+
["restaurant_id"]=>
91+
string(8) "40375376"
8392
}
84-
["borough"]=>
85-
string(9) "Manhattan"
86-
["name"]=>
87-
string(15) "Agra Restaurant"
88-
["restaurant_id"]=>
89-
string(8) "40375376"
9093
}
9194

9295
See Also

docs/reference/method/MongoDBCollection-findOneAndReplace.txt

Lines changed: 23 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -113,27 +113,33 @@ The following operation replaces the document with ``restaurant_id`` of
113113
[ 'returnDocument' => MongoDB\Operation\FindOneAndReplace::RETURN_DOCUMENT_AFTER ]
114114
);
115115

116-
var_dump($replacedRestaurant)
116+
var_dump($replacedRestaurant);
117117

118118
The output would then resemble::
119119

120-
object(stdClass)#14 (6) {
121-
["_id"]=>
122-
object(MongoDB\BSON\ObjectID)#11 (1) {
123-
["oid"]=>
124-
string(24) "576023c7b02fa9281da4139e"
125-
}
126-
["borough"]=>
127-
string(13) "Staten Island"
128-
["cuisine"]=>
129-
string(7) "Italian"
130-
["grades"]=>
131-
array(0) {
120+
object(MongoDB\Model\BSONDocument)#18 (1) {
121+
["storage":"ArrayObject":private]=>
122+
array(6) {
123+
["_id"]=>
124+
object(MongoDB\BSON\ObjectID)#11 (1) {
125+
["oid"]=>
126+
string(24) "594d5ef380a846852a4b5837"
127+
}
128+
["Borough"]=>
129+
string(13) "Staten Island"
130+
["cuisine"]=>
131+
string(7) "Italian"
132+
["grades"]=>
133+
object(MongoDB\Model\BSONArray)#17 (1) {
134+
["storage":"ArrayObject":private]=>
135+
array(0) {
136+
}
137+
}
138+
["name"]=>
139+
string(22) "Staten Island Pastaria"
140+
["restaurant_id"]=>
141+
string(9) "999999999"
132142
}
133-
["name"]=>
134-
string(22) "Staten Island Pastaria"
135-
["restaurant_id"]=>
136-
string(9) "999999999"
137143
}
138144

139145
See Also

docs/reference/method/MongoDBCollection-findOneAndUpdate.txt

Lines changed: 30 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -72,31 +72,40 @@ setting its building number to ``"761"``:
7272
]
7373
);
7474

75-
var_dump($updatedRestaurant)
75+
var_dump($updatedRestaurant);
7676

7777
The output would then resemble::
7878

79-
object(stdClass)#16 (2) {
80-
["_id"]=>
81-
object(MongoDB\BSON\ObjectID)#10 (1) {
82-
["oid"]=>
83-
string(24) "5813a08d29032c6e72d566a7"
84-
}
85-
["address"]=>
86-
object(stdClass)#15 (4) {
87-
["building"]=>
88-
string(3) "761"
89-
["coord"]=>
90-
array(2) {
91-
[0]=>
92-
float(-73.9925306)
93-
[1]=>
94-
float(40.7309346)
79+
object(MongoDB\Model\BSONDocument)#20 (1) {
80+
["storage":"ArrayObject":private]=>
81+
array(2) {
82+
["_id"]=>
83+
object(MongoDB\BSON\ObjectID)#12 (1) {
84+
["oid"]=>
85+
string(24) "594d5ef280a846852a4b3dee"
86+
}
87+
["address"]=>
88+
object(MongoDB\Model\BSONDocument)#19 (1) {
89+
["storage":"ArrayObject":private]=>
90+
array(4) {
91+
["building"]=>
92+
string(3) "761"
93+
["coord"]=>
94+
object(MongoDB\Model\BSONArray)#18 (1) {
95+
["storage":"ArrayObject":private]=>
96+
array(2) {
97+
[0]=>
98+
float(-73.9925306)
99+
[1]=>
100+
float(40.7309346)
101+
}
102+
}
103+
["street"]=>
104+
string(8) "Broadway"
105+
["zipcode"]=>
106+
string(5) "10003"
107+
}
95108
}
96-
["street"]=>
97-
string(8) "Broadway"
98-
["zipcode"]=>
99-
string(5) "10003"
100109
}
101110
}
102111

0 commit comments

Comments
 (0)