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
44e59fed
Commit
44e59fed
authored
Sep 14, 2017
by
Jeremy Mikola
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
PHPLIB-280: Rename ObjectID to ObjectId
parent
dcb4ccaa
Show whitespace changes
Inline
Side-by-side
Showing
27 changed files
with
57 additions
and
57 deletions
+57
-57
apiargs-MongoDBGridFSBucket-common-option.yaml
docs/includes/apiargs-MongoDBGridFSBucket-common-option.yaml
+1
-1
extracts-note.yaml
docs/includes/extracts-note.yaml
+1
-1
bson.txt
docs/reference/bson.txt
+2
-2
MongoDBBulkWriteResult-getInsertedIds.txt
...eference/method/MongoDBBulkWriteResult-getInsertedIds.txt
+1
-1
MongoDBBulkWriteResult-getUpsertedIds.txt
...eference/method/MongoDBBulkWriteResult-getUpsertedIds.txt
+1
-1
MongoDBCollection-find.txt
docs/reference/method/MongoDBCollection-find.txt
+5
-5
MongoDBCollection-findOne.txt
docs/reference/method/MongoDBCollection-findOne.txt
+4
-4
MongoDBCollection-findOneAndDelete.txt
docs/reference/method/MongoDBCollection-findOneAndDelete.txt
+1
-1
MongoDBCollection-findOneAndReplace.txt
.../reference/method/MongoDBCollection-findOneAndReplace.txt
+1
-1
MongoDBCollection-findOneAndUpdate.txt
docs/reference/method/MongoDBCollection-findOneAndUpdate.txt
+1
-1
MongoDBCollection-insertMany.txt
docs/reference/method/MongoDBCollection-insertMany.txt
+2
-2
MongoDBCollection-insertOne.txt
docs/reference/method/MongoDBCollection-insertOne.txt
+1
-1
MongoDBGridFSBucket-uploadFromStream.txt
...reference/method/MongoDBGridFSBucket-uploadFromStream.txt
+1
-1
MongoDBInsertManyResult-getInsertedIds.txt
...ference/method/MongoDBInsertManyResult-getInsertedIds.txt
+1
-1
MongoDBInsertOneResult-getInsertedId.txt
...reference/method/MongoDBInsertOneResult-getInsertedId.txt
+1
-1
MongoDBUpdateResult-getUpsertedId.txt
docs/reference/method/MongoDBUpdateResult-getUpsertedId.txt
+1
-1
commands.txt
docs/tutorial/commands.txt
+3
-3
crud.txt
docs/tutorial/crud.txt
+6
-6
BulkWriteResult.php
src/BulkWriteResult.php
+2
-2
InsertManyResult.php
src/InsertManyResult.php
+1
-1
InsertOneResult.php
src/InsertOneResult.php
+1
-1
UpdateResult.php
src/UpdateResult.php
+1
-1
DocumentationExamplesTest.php
tests/DocumentationExamplesTest.php
+9
-9
FunctionalTestCase.php
tests/FunctionalTestCase.php
+4
-4
BucketFunctionalTest.php
tests/GridFS/BucketFunctionalTest.php
+2
-2
SpecFunctionalTest.php
tests/GridFS/SpecFunctionalTest.php
+1
-1
MapReduceTest.php
tests/Operation/MapReduceTest.php
+2
-2
No files found.
docs/includes/apiargs-MongoDBGridFSBucket-common-option.yaml
View file @
44e59fed
...
@@ -3,7 +3,7 @@ name: _id
...
@@ -3,7 +3,7 @@ name: _id
type
:
mixed
type
:
mixed
description
:
|
description
:
|
Value to use as the file document identifier. Defaults to a new
Value to use as the file document identifier. Defaults to a new
:php:`MongoDB\\BSON\\ObjectI
D
<class.mongodb-bson-objectid>` object.
:php:`MongoDB\\BSON\\ObjectI
d
<class.mongodb-bson-objectid>` object.
interface
:
phpmethod
interface
:
phpmethod
operation
:
~
operation
:
~
optional
:
true
optional
:
true
...
...
docs/includes/extracts-note.yaml
View file @
44e59fed
...
@@ -7,6 +7,6 @@ content: |
...
@@ -7,6 +7,6 @@ content: |
<manual/en/language.types.type-juggling.php>` rules. When matching a special
<manual/en/language.types.type-juggling.php>` rules. When matching a special
BSON type the query criteria should use the respective :php:`BSON class
BSON type the query criteria should use the respective :php:`BSON class
<manual/en/book.bson.php>` in the driver (e.g. use
<manual/en/book.bson.php>` in the driver (e.g. use
:php:`MongoDB\\BSON\\ObjectI
D
<class.mongodb-bson-objectid>` to match an
:php:`MongoDB\\BSON\\ObjectI
d
<class.mongodb-bson-objectid>` to match an
:manual:`ObjectId </reference/object-id/>`).
:manual:`ObjectId </reference/object-id/>`).
...
...
docs/reference/bson.txt
View file @
44e59fed
...
@@ -124,7 +124,7 @@ Consider the following class definition:
...
@@ -124,7 +124,7 @@ Consider the following class definition:
public function __construct($name)
public function __construct($name)
{
{
$this->id = new MongoDB\BSON\ObjectI
D
;
$this->id = new MongoDB\BSON\ObjectI
d
;
$this->name = (string) $name;
$this->name = (string) $name;
$this->createdAt = new MongoDB\BSON\UTCDateTime;
$this->createdAt = new MongoDB\BSON\UTCDateTime;
}
}
...
@@ -167,7 +167,7 @@ The output would then resemble:
...
@@ -167,7 +167,7 @@ The output would then resemble:
object(Person)#18 (3) {
object(Person)#18 (3) {
["id":"Person":private]=>
["id":"Person":private]=>
object(MongoDB\BSON\ObjectI
D
)#15 (1) {
object(MongoDB\BSON\ObjectI
d
)#15 (1) {
["oid"]=>
["oid"]=>
string(24) "56fad2c36118fd2e9820cfc1"
string(24) "56fad2c36118fd2e9820cfc1"
}
}
...
...
docs/reference/method/MongoDBBulkWriteResult-getInsertedIds.txt
View file @
44e59fed
...
@@ -34,5 +34,5 @@ insert operations in the bulk write.
...
@@ -34,5 +34,5 @@ insert operations in the bulk write.
The index of each ID in the map corresponds to each document's position in the
The index of each ID in the map corresponds to each document's position in the
bulk operation. If a document had an ID prior to inserting (i.e. the driver did
bulk operation. If a document had an ID prior to inserting (i.e. the driver did
not generate an ID), the index will contain its ``_id`` field value. Any
not generate an ID), the index will contain its ``_id`` field value. Any
driver-generated ID will be a :php:`MongoDB\\BSON\\ObjectI
D
driver-generated ID will be a :php:`MongoDB\\BSON\\ObjectI
d
<class.mongodb-bson-objectid>` instance.
<class.mongodb-bson-objectid>` instance.
docs/reference/method/MongoDBBulkWriteResult-getUpsertedIds.txt
View file @
44e59fed
...
@@ -31,7 +31,7 @@ update and replace operations in the bulk write.
...
@@ -31,7 +31,7 @@ update and replace operations in the bulk write.
The index of each ID in the map corresponds to each document's position in the
The index of each ID in the map corresponds to each document's position in the
bulk operation. If a document had an ID prior to upserting (i.e. the server did
bulk operation. If a document had an ID prior to upserting (i.e. the server did
not generate an ID), the index will contain its ``_id`` field value. Any
not generate an ID), the index will contain its ``_id`` field value. Any
server-generated ID will be a :php:`MongoDB\\BSON\\ObjectI
D
server-generated ID will be a :php:`MongoDB\\BSON\\ObjectI
d
<class.mongodb-bson-objectid>` instance.
<class.mongodb-bson-objectid>` instance.
Errors/Exceptions
Errors/Exceptions
...
...
docs/reference/method/MongoDBCollection-find.txt
View file @
44e59fed
...
@@ -83,7 +83,7 @@ The output would then resemble::
...
@@ -83,7 +83,7 @@ The output would then resemble::
["storage":"ArrayObject":private]=>
["storage":"ArrayObject":private]=>
array(4) {
array(4) {
["_id"]=>
["_id"]=>
object(MongoDB\BSON\ObjectI
D
)#8 (1) {
object(MongoDB\BSON\ObjectI
d
)#8 (1) {
["oid"]=>
["oid"]=>
string(24) "576023c6b02fa9281da3f983"
string(24) "576023c6b02fa9281da3f983"
}
}
...
@@ -99,7 +99,7 @@ The output would then resemble::
...
@@ -99,7 +99,7 @@ The output would then resemble::
["storage":"ArrayObject":private]=>
["storage":"ArrayObject":private]=>
array(4) {
array(4) {
["_id"]=>
["_id"]=>
object(MongoDB\BSON\ObjectI
D
)#12 (1) {
object(MongoDB\BSON\ObjectI
d
)#12 (1) {
["oid"]=>
["oid"]=>
string(24) "576023c6b02fa9281da3f98d"
string(24) "576023c6b02fa9281da3f98d"
}
}
...
@@ -115,7 +115,7 @@ The output would then resemble::
...
@@ -115,7 +115,7 @@ The output would then resemble::
["storage":"ArrayObject":private]=>
["storage":"ArrayObject":private]=>
array(4) {
array(4) {
["_id"]=>
["_id"]=>
object(MongoDB\BSON\ObjectI
D
)#10 (1) {
object(MongoDB\BSON\ObjectI
d
)#10 (1) {
["oid"]=>
["oid"]=>
string(24) "576023c6b02fa9281da3f99b"
string(24) "576023c6b02fa9281da3f99b"
}
}
...
@@ -131,7 +131,7 @@ The output would then resemble::
...
@@ -131,7 +131,7 @@ The output would then resemble::
["storage":"ArrayObject":private]=>
["storage":"ArrayObject":private]=>
array(4) {
array(4) {
["_id"]=>
["_id"]=>
object(MongoDB\BSON\ObjectI
D
)#13 (1) {
object(MongoDB\BSON\ObjectI
d
)#13 (1) {
["oid"]=>
["oid"]=>
string(24) "576023c6b02fa9281da3f9a8"
string(24) "576023c6b02fa9281da3f9a8"
}
}
...
@@ -147,7 +147,7 @@ The output would then resemble::
...
@@ -147,7 +147,7 @@ The output would then resemble::
["storage":"ArrayObject":private]=>
["storage":"ArrayObject":private]=>
array(4) {
array(4) {
["_id"]=>
["_id"]=>
object(MongoDB\BSON\ObjectI
D
)#8 (1) {
object(MongoDB\BSON\ObjectI
d
)#8 (1) {
["oid"]=>
["oid"]=>
string(24) "576023c6b02fa9281da3f9b4"
string(24) "576023c6b02fa9281da3f9b4"
}
}
...
...
docs/reference/method/MongoDBCollection-findOne.txt
View file @
44e59fed
...
@@ -56,9 +56,9 @@ Matching BSON Types in Query Criteria
...
@@ -56,9 +56,9 @@ Matching BSON Types in Query Criteria
In the following example, documents in the ``restaurants`` collection use an
In the following example, documents in the ``restaurants`` collection use an
:manual:`ObjectId </reference/object-id/>` for their identifier (the default)
:manual:`ObjectId </reference/object-id/>` for their identifier (the default)
and documents in the ``zips`` collection use a string. Since ObjectI
D
is a
and documents in the ``zips`` collection use a string. Since ObjectI
d
is a
special BSON type, the query criteria for selecting a restaurant must use the
special BSON type, the query criteria for selecting a restaurant must use the
:php:`MongoDB\\BSON\\ObjectI
D
<class.mongodb-bson-objectid>` class.
:php:`MongoDB\\BSON\\ObjectI
d
<class.mongodb-bson-objectid>` class.
.. code-block:: php
.. code-block:: php
...
@@ -67,7 +67,7 @@ special BSON type, the query criteria for selecting a restaurant must use the
...
@@ -67,7 +67,7 @@ special BSON type, the query criteria for selecting a restaurant must use the
$zip = $database->zips->findOne(['_id' => '10036']);
$zip = $database->zips->findOne(['_id' => '10036']);
$restaurant = $database->restaurants->findOne([
$restaurant = $database->restaurants->findOne([
'_id' => new MongoDB\BSON\ObjectI
D
('594d5ef280a846852a4b3f70'),
'_id' => new MongoDB\BSON\ObjectI
d
('594d5ef280a846852a4b3f70'),
]);
]);
Projecting Fields
Projecting Fields
...
@@ -104,7 +104,7 @@ The output would then resemble::
...
@@ -104,7 +104,7 @@ The output would then resemble::
["storage":"ArrayObject":private]=>
["storage":"ArrayObject":private]=>
array(4) {
array(4) {
["_id"]=>
["_id"]=>
object(MongoDB\BSON\ObjectI
D
)#8 (1) {
object(MongoDB\BSON\ObjectI
d
)#8 (1) {
["oid"]=>
["oid"]=>
string(24) "576023c6b02fa9281da3f983"
string(24) "576023c6b02fa9281da3f983"
}
}
...
...
docs/reference/method/MongoDBCollection-findOneAndDelete.txt
View file @
44e59fed
...
@@ -79,7 +79,7 @@ The output would then resemble::
...
@@ -79,7 +79,7 @@ The output would then resemble::
["storage":"ArrayObject":private]=>
["storage":"ArrayObject":private]=>
array(4) {
array(4) {
["_id"]=>
["_id"]=>
object(MongoDB\BSON\ObjectI
D
)#11 (1) {
object(MongoDB\BSON\ObjectI
d
)#11 (1) {
["oid"]=>
["oid"]=>
string(24) "594d5ef280a846852a4b3f70"
string(24) "594d5ef280a846852a4b3f70"
}
}
...
...
docs/reference/method/MongoDBCollection-findOneAndReplace.txt
View file @
44e59fed
...
@@ -121,7 +121,7 @@ The output would then resemble::
...
@@ -121,7 +121,7 @@ The output would then resemble::
["storage":"ArrayObject":private]=>
["storage":"ArrayObject":private]=>
array(6) {
array(6) {
["_id"]=>
["_id"]=>
object(MongoDB\BSON\ObjectI
D
)#11 (1) {
object(MongoDB\BSON\ObjectI
d
)#11 (1) {
["oid"]=>
["oid"]=>
string(24) "594d5ef380a846852a4b5837"
string(24) "594d5ef380a846852a4b5837"
}
}
...
...
docs/reference/method/MongoDBCollection-findOneAndUpdate.txt
View file @
44e59fed
...
@@ -80,7 +80,7 @@ The output would then resemble::
...
@@ -80,7 +80,7 @@ The output would then resemble::
["storage":"ArrayObject":private]=>
["storage":"ArrayObject":private]=>
array(2) {
array(2) {
["_id"]=>
["_id"]=>
object(MongoDB\BSON\ObjectI
D
)#12 (1) {
object(MongoDB\BSON\ObjectI
d
)#12 (1) {
["oid"]=>
["oid"]=>
string(24) "594d5ef280a846852a4b3dee"
string(24) "594d5ef280a846852a4b3dee"
}
}
...
...
docs/reference/method/MongoDBCollection-insertMany.txt
View file @
44e59fed
...
@@ -84,12 +84,12 @@ The output would then resemble::
...
@@ -84,12 +84,12 @@ The output would then resemble::
Inserted 2 document(s)
Inserted 2 document(s)
array(2) {
array(2) {
[0]=>
[0]=>
object(MongoDB\BSON\ObjectI
D
)#11 (1) {
object(MongoDB\BSON\ObjectI
d
)#11 (1) {
["oid"]=>
["oid"]=>
string(24) "579a25921f417dd1e5518141"
string(24) "579a25921f417dd1e5518141"
}
}
[1]=>
[1]=>
object(MongoDB\BSON\ObjectI
D
)#12 (1) {
object(MongoDB\BSON\ObjectI
d
)#12 (1) {
["oid"]=>
["oid"]=>
string(24) "579a25921f417dd1e5518142"
string(24) "579a25921f417dd1e5518142"
}
}
...
...
docs/reference/method/MongoDBCollection-insertOne.txt
View file @
44e59fed
...
@@ -74,7 +74,7 @@ The following operation inserts a document into the ``users`` collection in the
...
@@ -74,7 +74,7 @@ The following operation inserts a document into the ``users`` collection in the
The output would then resemble::
The output would then resemble::
Inserted 1 document(s)
Inserted 1 document(s)
object(MongoDB\BSON\ObjectI
D
)#11 (1) {
object(MongoDB\BSON\ObjectI
d
)#11 (1) {
["oid"]=>
["oid"]=>
string(24) "579a25921f417dd1e5518141"
string(24) "579a25921f417dd1e5518141"
}
}
...
...
docs/reference/method/MongoDBGridFSBucket-uploadFromStream.txt
View file @
44e59fed
...
@@ -34,7 +34,7 @@ Return Values
...
@@ -34,7 +34,7 @@ Return Values
The ``_id`` field of the metadata document associated with the newly created
The ``_id`` field of the metadata document associated with the newly created
GridFS file. If the ``_id`` option is not specified, a new
GridFS file. If the ``_id`` option is not specified, a new
:php:`MongoDB\\BSON\\ObjectI
D
<class.mongodb-bson-objectid>` object will be used
:php:`MongoDB\\BSON\\ObjectI
d
<class.mongodb-bson-objectid>` object will be used
by default.
by default.
Errors/Exceptions
Errors/Exceptions
...
...
docs/reference/method/MongoDBInsertManyResult-getInsertedIds.txt
View file @
44e59fed
...
@@ -32,5 +32,5 @@ A map of IDs (i.e. ``_id`` field values) for the inserted documents.
...
@@ -32,5 +32,5 @@ A map of IDs (i.e. ``_id`` field values) for the inserted documents.
The index of each ID in the map corresponds to each document's position in the
The index of each ID in the map corresponds to each document's position in the
bulk operation. If a document had an ID prior to inserting (i.e. the driver did
bulk operation. If a document had an ID prior to inserting (i.e. the driver did
not generate an ID), the index will contain its ``_id`` field value. Any
not generate an ID), the index will contain its ``_id`` field value. Any
driver-generated ID will be a :php:`MongoDB\\BSON\\ObjectI
D
driver-generated ID will be a :php:`MongoDB\\BSON\\ObjectI
d
<class.mongodb-bson-objectid>` instance.
<class.mongodb-bson-objectid>` instance.
docs/reference/method/MongoDBInsertOneResult-getInsertedId.txt
View file @
44e59fed
...
@@ -31,5 +31,5 @@ The ID (i.e. ``_id`` field value) of the inserted document.
...
@@ -31,5 +31,5 @@ The ID (i.e. ``_id`` field value) of the inserted document.
If the document had an ID prior to inserting (i.e. the driver did not need to
If the document had an ID prior to inserting (i.e. the driver did not need to
generate an ID), this will contain its ``_id`` field value. Any driver-generated
generate an ID), this will contain its ``_id`` field value. Any driver-generated
ID will be a :php:`MongoDB\\BSON\\ObjectI
D
<class.mongodb-bson-objectid>`
ID will be a :php:`MongoDB\\BSON\\ObjectI
d
<class.mongodb-bson-objectid>`
instance.
instance.
docs/reference/method/MongoDBUpdateResult-getUpsertedId.txt
View file @
44e59fed
...
@@ -29,7 +29,7 @@ upserted, ``null`` will be returned.
...
@@ -29,7 +29,7 @@ upserted, ``null`` will be returned.
If the document had an ID prior to upserting (i.e. the server did not need to
If the document had an ID prior to upserting (i.e. the server did not need to
generate an ID), this will contain its ``_id`` field value. Any server-generated
generate an ID), this will contain its ``_id`` field value. Any server-generated
ID will be a :php:`MongoDB\\BSON\\ObjectI
D
<class.mongodb-bson-objectid>`
ID will be a :php:`MongoDB\\BSON\\ObjectI
d
<class.mongodb-bson-objectid>`
instance.
instance.
Errors/Exceptions
Errors/Exceptions
...
...
docs/tutorial/commands.txt
View file @
44e59fed
...
@@ -74,7 +74,7 @@ The output would then resemble::
...
@@ -74,7 +74,7 @@ The output would then resemble::
["storage":"ArrayObject":private]=>
["storage":"ArrayObject":private]=>
array(3) {
array(3) {
["_id"]=>
["_id"]=>
object(MongoDB\BSON\ObjectI
D
)#3 (1) {
object(MongoDB\BSON\ObjectI
d
)#3 (1) {
["oid"]=>
["oid"]=>
string(24) "55cba2486c522cafdb059bed"
string(24) "55cba2486c522cafdb059bed"
}
}
...
@@ -113,7 +113,7 @@ The output would then resemble::
...
@@ -113,7 +113,7 @@ The output would then resemble::
["storage":"ArrayObject":private]=>
["storage":"ArrayObject":private]=>
array(3) {
array(3) {
["_id"]=>
["_id"]=>
object(MongoDB\BSON\ObjectI
D
)#15 (1) {
object(MongoDB\BSON\ObjectI
d
)#15 (1) {
["oid"]=>
["oid"]=>
string(24) "55cba2476c522cafdb0544df"
string(24) "55cba2476c522cafdb0544df"
}
}
...
@@ -152,7 +152,7 @@ The output would then resemble::
...
@@ -152,7 +152,7 @@ The output would then resemble::
["storage":"ArrayObject":private]=>
["storage":"ArrayObject":private]=>
array(3) {
array(3) {
["_id"]=>
["_id"]=>
object(MongoDB\BSON\ObjectI
D
)#20 (1) {
object(MongoDB\BSON\ObjectI
d
)#20 (1) {
["oid"]=>
["oid"]=>
string(24) "55cba2476c522cafdb053c92"
string(24) "55cba2476c522cafdb053c92"
}
}
...
...
docs/tutorial/crud.txt
View file @
44e59fed
...
@@ -145,7 +145,7 @@ The output would then resemble::
...
@@ -145,7 +145,7 @@ The output would then resemble::
``"94301"``. The same criteria would not have matched a document with an
``"94301"``. The same criteria would not have matched a document with an
integer value of ``94301`` due to MongoDB's :manual:`comparison rules for
integer value of ``94301`` due to MongoDB's :manual:`comparison rules for
BSON types </reference/bson-type-comparison-order>`. Similarly, users should
BSON types </reference/bson-type-comparison-order>`. Similarly, users should
use a :php:`MongoDB\\BSON\\ObjectI
D
<class.mongodb-bson-objectid>` object
use a :php:`MongoDB\\BSON\\ObjectI
d
<class.mongodb-bson-objectid>` object
when matching an ``_id`` with an :manual:`ObjectId </reference/object-id/>`
when matching an ``_id`` with an :manual:`ObjectId </reference/object-id/>`
value, as strings and ObjectIds are not directly comparable.
value, as strings and ObjectIds are not directly comparable.
...
@@ -237,7 +237,7 @@ The output would then resemble::
...
@@ -237,7 +237,7 @@ The output would then resemble::
["storage":"ArrayObject":private]=>
["storage":"ArrayObject":private]=>
array(4) {
array(4) {
["_id"]=>
["_id"]=>
object(MongoDB\BSON\ObjectI
D
)#8 (1) {
object(MongoDB\BSON\ObjectI
d
)#8 (1) {
["oid"]=>
["oid"]=>
string(24) "576023c6b02fa9281da3f983"
string(24) "576023c6b02fa9281da3f983"
}
}
...
@@ -253,7 +253,7 @@ The output would then resemble::
...
@@ -253,7 +253,7 @@ The output would then resemble::
["storage":"ArrayObject":private]=>
["storage":"ArrayObject":private]=>
array(4) {
array(4) {
["_id"]=>
["_id"]=>
object(MongoDB\BSON\ObjectI
D
)#12 (1) {
object(MongoDB\BSON\ObjectI
d
)#12 (1) {
["oid"]=>
["oid"]=>
string(24) "576023c6b02fa9281da3f98d"
string(24) "576023c6b02fa9281da3f98d"
}
}
...
@@ -269,7 +269,7 @@ The output would then resemble::
...
@@ -269,7 +269,7 @@ The output would then resemble::
["storage":"ArrayObject":private]=>
["storage":"ArrayObject":private]=>
array(4) {
array(4) {
["_id"]=>
["_id"]=>
object(MongoDB\BSON\ObjectI
D
)#10 (1) {
object(MongoDB\BSON\ObjectI
d
)#10 (1) {
["oid"]=>
["oid"]=>
string(24) "576023c6b02fa9281da3f99b"
string(24) "576023c6b02fa9281da3f99b"
}
}
...
@@ -285,7 +285,7 @@ The output would then resemble::
...
@@ -285,7 +285,7 @@ The output would then resemble::
["storage":"ArrayObject":private]=>
["storage":"ArrayObject":private]=>
array(4) {
array(4) {
["_id"]=>
["_id"]=>
object(MongoDB\BSON\ObjectI
D
)#13 (1) {
object(MongoDB\BSON\ObjectI
d
)#13 (1) {
["oid"]=>
["oid"]=>
string(24) "576023c6b02fa9281da3f9a8"
string(24) "576023c6b02fa9281da3f9a8"
}
}
...
@@ -658,7 +658,7 @@ The output would then resemble::
...
@@ -658,7 +658,7 @@ The output would then resemble::
["storage":"ArrayObject":private]=>
["storage":"ArrayObject":private]=>
array(3) {
array(3) {
["_id"]=>
["_id"]=>
object(MongoDB\BSON\ObjectI
D
)#15 (1) {
object(MongoDB\BSON\ObjectI
d
)#15 (1) {
["oid"]=>
["oid"]=>
string(24) "57509c4406d7241dad86e7c3"
string(24) "57509c4406d7241dad86e7c3"
}
}
...
...
src/BulkWriteResult.php
View file @
44e59fed
...
@@ -84,7 +84,7 @@ class BulkWriteResult
...
@@ -84,7 +84,7 @@ class BulkWriteResult
* The index of each ID in the map corresponds to each document's position
* The index of each ID in the map corresponds to each document's position
* in the bulk operation. If a document had an ID prior to inserting (i.e.
* in the bulk operation. If a document had an ID prior to inserting (i.e.
* the driver did not generate an ID), the index will contain its "_id"
* the driver did not generate an ID), the index will contain its "_id"
* field value. Any driver-generated ID will be a MongoDB\BSON\ObjectI
D
* field value. Any driver-generated ID will be a MongoDB\BSON\ObjectI
d
* instance.
* instance.
*
*
* @return mixed[]
* @return mixed[]
...
@@ -157,7 +157,7 @@ class BulkWriteResult
...
@@ -157,7 +157,7 @@ class BulkWriteResult
* The index of each ID in the map corresponds to each document's position
* The index of each ID in the map corresponds to each document's position
* in bulk operation. If a document had an ID prior to upserting (i.e. the
* in bulk operation. If a document had an ID prior to upserting (i.e. the
* server did not need to generate an ID), this will contain its "_id". Any
* server did not need to generate an ID), this will contain its "_id". Any
* server-generated ID will be a MongoDB\BSON\ObjectI
D
instance.
* server-generated ID will be a MongoDB\BSON\ObjectI
d
instance.
*
*
* This method should only be called if the write was acknowledged.
* This method should only be called if the write was acknowledged.
*
*
...
...
src/InsertManyResult.php
View file @
44e59fed
...
@@ -66,7 +66,7 @@ class InsertManyResult
...
@@ -66,7 +66,7 @@ class InsertManyResult
* The index of each ID in the map corresponds to each document's position
* The index of each ID in the map corresponds to each document's position
* in the bulk operation. If a document had an ID prior to inserting (i.e.
* in the bulk operation. If a document had an ID prior to inserting (i.e.
* the driver did not generate an ID), the index will contain its "_id"
* the driver did not generate an ID), the index will contain its "_id"
* field value. Any driver-generated ID will be a MongoDB\BSON\ObjectI
D
* field value. Any driver-generated ID will be a MongoDB\BSON\ObjectI
d
* instance.
* instance.
*
*
* @return mixed[]
* @return mixed[]
...
...
src/InsertOneResult.php
View file @
44e59fed
...
@@ -65,7 +65,7 @@ class InsertOneResult
...
@@ -65,7 +65,7 @@ class InsertOneResult
*
*
* If the document had an ID prior to inserting (i.e. the driver did not
* If the document had an ID prior to inserting (i.e. the driver did not
* need to generate an ID), this will contain its "_id". Any
* need to generate an ID), this will contain its "_id". Any
* driver-generated ID will be a MongoDB\BSON\ObjectI
D
instance.
* driver-generated ID will be a MongoDB\BSON\ObjectI
d
instance.
*
*
* @return mixed
* @return mixed
*/
*/
...
...
src/UpdateResult.php
View file @
44e59fed
...
@@ -101,7 +101,7 @@ class UpdateResult
...
@@ -101,7 +101,7 @@ class UpdateResult
*
*
* If the document had an ID prior to upserting (i.e. the server did not
* If the document had an ID prior to upserting (i.e. the server did not
* need to generate an ID), this will contain its "_id". Any
* need to generate an ID), this will contain its "_id". Any
* server-generated ID will be a MongoDB\BSON\ObjectI
D
instance.
* server-generated ID will be a MongoDB\BSON\ObjectI
d
instance.
*
*
* This value is undefined (i.e. null) if an upsert did not take place.
* This value is undefined (i.e. null) if an upsert did not take place.
*
*
...
...
tests/DocumentationExamplesTest.php
View file @
44e59fed
...
@@ -46,7 +46,7 @@ class DocumentationExamplesTest extends FunctionalTestCase
...
@@ -46,7 +46,7 @@ class DocumentationExamplesTest extends FunctionalTestCase
// End Example 1
// End Example 1
$this
->
assertSame
(
1
,
$insertOneResult
->
getInsertedCount
());
$this
->
assertSame
(
1
,
$insertOneResult
->
getInsertedCount
());
$this
->
assertInstanceOf
(
'MongoDB\BSON\ObjectI
D
'
,
$insertOneResult
->
getInsertedId
());
$this
->
assertInstanceOf
(
'MongoDB\BSON\ObjectI
d
'
,
$insertOneResult
->
getInsertedId
());
$this
->
assertInventoryCount
(
1
);
$this
->
assertInventoryCount
(
1
);
// Start Example 2
// Start Example 2
...
@@ -85,7 +85,7 @@ class DocumentationExamplesTest extends FunctionalTestCase
...
@@ -85,7 +85,7 @@ class DocumentationExamplesTest extends FunctionalTestCase
$this
->
assertSame
(
3
,
$insertManyResult
->
getInsertedCount
());
$this
->
assertSame
(
3
,
$insertManyResult
->
getInsertedCount
());
foreach
(
$insertManyResult
->
getInsertedIds
()
as
$id
)
{
foreach
(
$insertManyResult
->
getInsertedIds
()
as
$id
)
{
$this
->
assertInstanceOf
(
'MongoDB\BSON\ObjectI
D
'
,
$id
);
$this
->
assertInstanceOf
(
'MongoDB\BSON\ObjectI
d
'
,
$id
);
}
}
$this
->
assertInventoryCount
(
3
);
$this
->
assertInventoryCount
(
3
);
}
}
...
@@ -131,7 +131,7 @@ class DocumentationExamplesTest extends FunctionalTestCase
...
@@ -131,7 +131,7 @@ class DocumentationExamplesTest extends FunctionalTestCase
$this
->
assertSame
(
5
,
$insertManyResult
->
getInsertedCount
());
$this
->
assertSame
(
5
,
$insertManyResult
->
getInsertedCount
());
foreach
(
$insertManyResult
->
getInsertedIds
()
as
$id
)
{
foreach
(
$insertManyResult
->
getInsertedIds
()
as
$id
)
{
$this
->
assertInstanceOf
(
'MongoDB\BSON\ObjectI
D
'
,
$id
);
$this
->
assertInstanceOf
(
'MongoDB\BSON\ObjectI
d
'
,
$id
);
}
}
$this
->
assertInventoryCount
(
5
);
$this
->
assertInventoryCount
(
5
);
...
@@ -234,7 +234,7 @@ class DocumentationExamplesTest extends FunctionalTestCase
...
@@ -234,7 +234,7 @@ class DocumentationExamplesTest extends FunctionalTestCase
$this
->
assertSame
(
5
,
$insertManyResult
->
getInsertedCount
());
$this
->
assertSame
(
5
,
$insertManyResult
->
getInsertedCount
());
foreach
(
$insertManyResult
->
getInsertedIds
()
as
$id
)
{
foreach
(
$insertManyResult
->
getInsertedIds
()
as
$id
)
{
$this
->
assertInstanceOf
(
'MongoDB\BSON\ObjectI
D
'
,
$id
);
$this
->
assertInstanceOf
(
'MongoDB\BSON\ObjectI
d
'
,
$id
);
}
}
$this
->
assertInventoryCount
(
5
);
$this
->
assertInventoryCount
(
5
);
...
@@ -314,7 +314,7 @@ class DocumentationExamplesTest extends FunctionalTestCase
...
@@ -314,7 +314,7 @@ class DocumentationExamplesTest extends FunctionalTestCase
$this
->
assertSame
(
5
,
$insertManyResult
->
getInsertedCount
());
$this
->
assertSame
(
5
,
$insertManyResult
->
getInsertedCount
());
foreach
(
$insertManyResult
->
getInsertedIds
()
as
$id
)
{
foreach
(
$insertManyResult
->
getInsertedIds
()
as
$id
)
{
$this
->
assertInstanceOf
(
'MongoDB\BSON\ObjectI
D
'
,
$id
);
$this
->
assertInstanceOf
(
'MongoDB\BSON\ObjectI
d
'
,
$id
);
}
}
$this
->
assertInventoryCount
(
5
);
$this
->
assertInventoryCount
(
5
);
...
@@ -424,7 +424,7 @@ class DocumentationExamplesTest extends FunctionalTestCase
...
@@ -424,7 +424,7 @@ class DocumentationExamplesTest extends FunctionalTestCase
$this
->
assertSame
(
5
,
$insertManyResult
->
getInsertedCount
());
$this
->
assertSame
(
5
,
$insertManyResult
->
getInsertedCount
());
foreach
(
$insertManyResult
->
getInsertedIds
()
as
$id
)
{
foreach
(
$insertManyResult
->
getInsertedIds
()
as
$id
)
{
$this
->
assertInstanceOf
(
'MongoDB\BSON\ObjectI
D
'
,
$id
);
$this
->
assertInstanceOf
(
'MongoDB\BSON\ObjectI
d
'
,
$id
);
}
}
$this
->
assertInventoryCount
(
5
);
$this
->
assertInventoryCount
(
5
);
...
@@ -565,7 +565,7 @@ class DocumentationExamplesTest extends FunctionalTestCase
...
@@ -565,7 +565,7 @@ class DocumentationExamplesTest extends FunctionalTestCase
$this
->
assertSame
(
5
,
$insertManyResult
->
getInsertedCount
());
$this
->
assertSame
(
5
,
$insertManyResult
->
getInsertedCount
());
foreach
(
$insertManyResult
->
getInsertedIds
()
as
$id
)
{
foreach
(
$insertManyResult
->
getInsertedIds
()
as
$id
)
{
$this
->
assertInstanceOf
(
'MongoDB\BSON\ObjectI
D
'
,
$id
);
$this
->
assertInstanceOf
(
'MongoDB\BSON\ObjectI
d
'
,
$id
);
}
}
$this
->
assertInventoryCount
(
5
);
$this
->
assertInventoryCount
(
5
);
...
@@ -785,7 +785,7 @@ class DocumentationExamplesTest extends FunctionalTestCase
...
@@ -785,7 +785,7 @@ class DocumentationExamplesTest extends FunctionalTestCase
$this
->
assertSame
(
10
,
$insertManyResult
->
getInsertedCount
());
$this
->
assertSame
(
10
,
$insertManyResult
->
getInsertedCount
());
foreach
(
$insertManyResult
->
getInsertedIds
()
as
$id
)
{
foreach
(
$insertManyResult
->
getInsertedIds
()
as
$id
)
{
$this
->
assertInstanceOf
(
'MongoDB\BSON\ObjectI
D
'
,
$id
);
$this
->
assertInstanceOf
(
'MongoDB\BSON\ObjectI
d
'
,
$id
);
}
}
$this
->
assertInventoryCount
(
10
);
$this
->
assertInventoryCount
(
10
);
...
@@ -897,7 +897,7 @@ class DocumentationExamplesTest extends FunctionalTestCase
...
@@ -897,7 +897,7 @@ class DocumentationExamplesTest extends FunctionalTestCase
$this
->
assertSame
(
5
,
$insertManyResult
->
getInsertedCount
());
$this
->
assertSame
(
5
,
$insertManyResult
->
getInsertedCount
());
foreach
(
$insertManyResult
->
getInsertedIds
()
as
$id
)
{
foreach
(
$insertManyResult
->
getInsertedIds
()
as
$id
)
{
$this
->
assertInstanceOf
(
'MongoDB\BSON\ObjectI
D
'
,
$id
);
$this
->
assertInstanceOf
(
'MongoDB\BSON\ObjectI
d
'
,
$id
);
}
}
$this
->
assertInventoryCount
(
5
);
$this
->
assertInventoryCount
(
5
);
...
...
tests/FunctionalTestCase.php
View file @
44e59fed
...
@@ -41,11 +41,11 @@ abstract class FunctionalTestCase extends TestCase
...
@@ -41,11 +41,11 @@ abstract class FunctionalTestCase extends TestCase
$this
->
assertEquals
(
1
,
$document
[
'ok'
]);
$this
->
assertEquals
(
1
,
$document
[
'ok'
]);
}
}
protected
function
assertSameObjectI
D
(
$expectedObjectID
,
$actualObjectID
)
protected
function
assertSameObjectI
d
(
$expectedObjectId
,
$actualObjectId
)
{
{
$this
->
assertInstanceOf
(
'MongoDB\BSON\ObjectI
D'
,
$expectedObjectID
);
$this
->
assertInstanceOf
(
'MongoDB\BSON\ObjectI
d'
,
$expectedObjectId
);
$this
->
assertInstanceOf
(
'MongoDB\BSON\ObjectI
D'
,
$actualObjectID
);
$this
->
assertInstanceOf
(
'MongoDB\BSON\ObjectI
d'
,
$actualObjectId
);
$this
->
assertEquals
((
string
)
$expectedObjectI
D
,
(
string
)
$actualObjectID
);
$this
->
assertEquals
((
string
)
$expectedObjectI
d
,
(
string
)
$actualObjectId
);
}
}
protected
function
assertSameDocument
(
$expectedDocument
,
$actualDocument
)
protected
function
assertSameDocument
(
$expectedDocument
,
$actualDocument
)
...
...
tests/GridFS/BucketFunctionalTest.php
View file @
44e59fed
...
@@ -388,7 +388,7 @@ class BucketFunctionalTest extends FunctionalTestCase
...
@@ -388,7 +388,7 @@ class BucketFunctionalTest extends FunctionalTestCase
$fileDocument
=
$this
->
bucket
->
getFileDocumentForStream
(
$stream
);
$fileDocument
=
$this
->
bucket
->
getFileDocumentForStream
(
$stream
);
$this
->
assertSameObjectI
D
(
$id
,
$fileDocument
->
_id
);
$this
->
assertSameObjectI
d
(
$id
,
$fileDocument
->
_id
);
$this
->
assertSame
(
'filename'
,
$fileDocument
->
filename
);
$this
->
assertSame
(
'filename'
,
$fileDocument
->
filename
);
$this
->
assertSame
(
6
,
$fileDocument
->
length
);
$this
->
assertSame
(
6
,
$fileDocument
->
length
);
$this
->
assertSameDocument
(
$metadata
,
$fileDocument
->
metadata
);
$this
->
assertSameDocument
(
$metadata
,
$fileDocument
->
metadata
);
...
@@ -435,7 +435,7 @@ class BucketFunctionalTest extends FunctionalTestCase
...
@@ -435,7 +435,7 @@ class BucketFunctionalTest extends FunctionalTestCase
$id
=
$this
->
bucket
->
uploadFromStream
(
'filename'
,
$this
->
createStream
(
'foobar'
));
$id
=
$this
->
bucket
->
uploadFromStream
(
'filename'
,
$this
->
createStream
(
'foobar'
));
$stream
=
$this
->
bucket
->
openDownloadStream
(
$id
);
$stream
=
$this
->
bucket
->
openDownloadStream
(
$id
);
$this
->
assertSameObjectI
D
(
$id
,
$this
->
bucket
->
getFileIdForStream
(
$stream
));
$this
->
assertSameObjectI
d
(
$id
,
$this
->
bucket
->
getFileIdForStream
(
$stream
));
}
}
public
function
testGetFileIdForStreamWithWritableStream
()
public
function
testGetFileIdForStreamWithWritableStream
()
...
...
tests/GridFS/SpecFunctionalTest.php
View file @
44e59fed
...
@@ -118,7 +118,7 @@ class SpecFunctionalTest extends FunctionalTestCase
...
@@ -118,7 +118,7 @@ class SpecFunctionalTest extends FunctionalTestCase
/**
/**
* Convert encoded types in the array and return the modified array.
* Convert encoded types in the array and return the modified array.
*
*
* Nested arrays with "$oid" and "$date" keys will be converted to ObjectI
D
* Nested arrays with "$oid" and "$date" keys will be converted to ObjectI
d
* and UTCDateTime instances, respectively. Nested arrays with "$hex" keys
* and UTCDateTime instances, respectively. Nested arrays with "$hex" keys
* will be converted to a string or Binary object.
* will be converted to a string or Binary object.
*
*
...
...
tests/Operation/MapReduceTest.php
View file @
44e59fed
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
namespace
MongoDB\Tests\Operation
;
namespace
MongoDB\Tests\Operation
;
use
MongoDB\BSON\Javascript
;
use
MongoDB\BSON\Javascript
;
use
MongoDB\BSON\ObjectI
D
;
use
MongoDB\BSON\ObjectI
d
;
use
MongoDB\Operation\MapReduce
;
use
MongoDB\Operation\MapReduce
;
use
stdClass
;
use
stdClass
;
...
@@ -104,6 +104,6 @@ class MapReduceTest extends TestCase
...
@@ -104,6 +104,6 @@ class MapReduceTest extends TestCase
private
function
getInvalidJavascriptValues
()
private
function
getInvalidJavascriptValues
()
{
{
return
[
123
,
3.14
,
'foo'
,
true
,
[],
new
stdClass
,
new
ObjectI
D
];
return
[
123
,
3.14
,
'foo'
,
true
,
[],
new
stdClass
,
new
ObjectI
d
];
}
}
}
}
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