Skip to content

Commit b4eed02

Browse files
committed
Note that non-arrays may also be used as documents
1 parent cb3e7f1 commit b4eed02

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

docs/tutorial/crud.md

+15
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,21 @@ This page covers the following common use cases:
2828
documents at a time
2929
* [Aggregating](#aggregating-documents) documents
3030

31+
Note that the use of arrays to express documents in the following examples was
32+
done for simplicity. The driver will also accept instances of stdClass or
33+
[MongoDB\BSON\Serializable][serializable]) for these arguments (e.g. query
34+
filters, inserted documents, update documents).
35+
36+
[serializable]: http://php.net/mongodb-bson-serializable
37+
38+
Documents destined for database storage (e.g. insert documents, replacement
39+
documents, embedded documents included in an update operation) may also be
40+
instances of [MongoDB\BSON\Persistable][persistable]. See
41+
[Persistable Classes][persistable-classes] for more information.
42+
43+
[persistable]: http://php.net/mongodb-bson-persistable
44+
[persistable-classes]: bson.md#persistable-classes
45+
3146
## Finding One Document
3247

3348
The [findOne()][findone] method returns the first matched document, or null if

0 commit comments

Comments
 (0)