Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
M
mongo-php-library
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
sinan
mongo-php-library
Commits
ca084014
Commit
ca084014
authored
Jun 23, 2017
by
Jeremy Mikola
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'v1.1'
parents
6385fe0b
6b763fb0
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
68 additions
and
50 deletions
+68
-50
MongoDBCollection-findOne.txt
docs/reference/method/MongoDBCollection-findOne.txt
+1
-1
MongoDBCollection-findOneAndDelete.txt
docs/reference/method/MongoDBCollection-findOneAndDelete.txt
+14
-11
MongoDBCollection-findOneAndReplace.txt
.../reference/method/MongoDBCollection-findOneAndReplace.txt
+23
-17
MongoDBCollection-findOneAndUpdate.txt
docs/reference/method/MongoDBCollection-findOneAndUpdate.txt
+30
-21
No files found.
docs/reference/method/MongoDBCollection-findOne.txt
View file @
ca084014
...
@@ -68,7 +68,7 @@ special BSON type, the query criteria for selecting a restaurant must use the
...
@@ -68,7 +68,7 @@ special BSON type, the query criteria for selecting a restaurant must use the
$restaurant = $database->restaurants->findOne([
$restaurant = $database->restaurants->findOne([
'_id' => new MongoDB\BSON\ObjectID('594d5ef280a846852a4b3f70'),
'_id' => new MongoDB\BSON\ObjectID('594d5ef280a846852a4b3f70'),
])
])
;
Projecting Fields
Projecting Fields
~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~
...
...
docs/reference/method/MongoDBCollection-findOneAndDelete.txt
View file @
ca084014
...
@@ -75,11 +75,13 @@ The following example finds and deletes the document with ``restaurant_id`` of
...
@@ -75,11 +75,13 @@ The following example finds and deletes the document with ``restaurant_id`` of
The output would then resemble::
The output would then resemble::
object(stdClass)#14 (4) {
object(MongoDB\Model\BSONDocument)#17 (1) {
["storage":"ArrayObject":private]=>
array(4) {
["_id"]=>
["_id"]=>
object(MongoDB\BSON\ObjectID)#11 (1) {
object(MongoDB\BSON\ObjectID)#11 (1) {
["oid"]=>
["oid"]=>
string(24) "576023c6b02fa9281da3fad9
"
string(24) "594d5ef280a846852a4b3f70
"
}
}
["borough"]=>
["borough"]=>
string(9) "Manhattan"
string(9) "Manhattan"
...
@@ -88,6 +90,7 @@ The output would then resemble::
...
@@ -88,6 +90,7 @@ The output would then resemble::
["restaurant_id"]=>
["restaurant_id"]=>
string(8) "40375376"
string(8) "40375376"
}
}
}
See Also
See Also
--------
--------
...
...
docs/reference/method/MongoDBCollection-findOneAndReplace.txt
View file @
ca084014
...
@@ -113,28 +113,34 @@ The following operation replaces the document with ``restaurant_id`` of
...
@@ -113,28 +113,34 @@ The following operation replaces the document with ``restaurant_id`` of
[ 'returnDocument' => MongoDB\Operation\FindOneAndReplace::RETURN_DOCUMENT_AFTER ]
[ 'returnDocument' => MongoDB\Operation\FindOneAndReplace::RETURN_DOCUMENT_AFTER ]
);
);
var_dump($replacedRestaurant)
var_dump($replacedRestaurant)
;
The output would then resemble::
The output would then resemble::
object(stdClass)#14 (6) {
object(MongoDB\Model\BSONDocument)#18 (1) {
["storage":"ArrayObject":private]=>
array(6) {
["_id"]=>
["_id"]=>
object(MongoDB\BSON\ObjectID)#11 (1) {
object(MongoDB\BSON\ObjectID)#11 (1) {
["oid"]=>
["oid"]=>
string(24) "576023c7b02fa9281da4139e
"
string(24) "594d5ef380a846852a4b5837
"
}
}
["b
orough"]=>
["B
orough"]=>
string(13) "Staten Island"
string(13) "Staten Island"
["cuisine"]=>
["cuisine"]=>
string(7) "Italian"
string(7) "Italian"
["grades"]=>
["grades"]=>
object(MongoDB\Model\BSONArray)#17 (1) {
["storage":"ArrayObject":private]=>
array(0) {
array(0) {
}
}
}
["name"]=>
["name"]=>
string(22) "Staten Island Pastaria"
string(22) "Staten Island Pastaria"
["restaurant_id"]=>
["restaurant_id"]=>
string(9) "999999999"
string(9) "999999999"
}
}
}
See Also
See Also
--------
--------
...
...
docs/reference/method/MongoDBCollection-findOneAndUpdate.txt
View file @
ca084014
...
@@ -72,33 +72,42 @@ setting its building number to ``"761"``:
...
@@ -72,33 +72,42 @@ setting its building number to ``"761"``:
]
]
);
);
var_dump($updatedRestaurant)
var_dump($updatedRestaurant)
;
The output would then resemble::
The output would then resemble::
object(stdClass)#16 (2) {
object(MongoDB\Model\BSONDocument)#20 (1) {
["storage":"ArrayObject":private]=>
array(2) {
["_id"]=>
["_id"]=>
object(MongoDB\BSON\ObjectID)#10
(1) {
object(MongoDB\BSON\ObjectID)#12
(1) {
["oid"]=>
["oid"]=>
string(24) "5813a08d29032c6e72d566a7
"
string(24) "594d5ef280a846852a4b3dee
"
}
}
["address"]=>
["address"]=>
object(stdClass)#15 (4) {
object(MongoDB\Model\BSONDocument)#19 (1) {
["storage":"ArrayObject":private]=>
array(4) {
["building"]=>
["building"]=>
string(3) "761"
string(3) "761"
["coord"]=>
["coord"]=>
object(MongoDB\Model\BSONArray)#18 (1) {
["storage":"ArrayObject":private]=>
array(2) {
array(2) {
[0]=>
[0]=>
float(-73.9925306)
float(-73.9925306)
[1]=>
[1]=>
float(40.7309346)
float(40.7309346)
}
}
}
["street"]=>
["street"]=>
string(8) "Broadway"
string(8) "Broadway"
["zipcode"]=>
["zipcode"]=>
string(5) "10003"
string(5) "10003"
}
}
}
}
}
}
See Also
See Also
--------
--------
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment