Commit ec1ae3ae authored by Jeremy Mikola's avatar Jeremy Mikola

Revise Collection and Database class intros

parent 6be57505
...@@ -17,35 +17,37 @@ Definition ...@@ -17,35 +17,37 @@ Definition
Provides methods for common operations on collections and documents, Provides methods for common operations on collections and documents,
including CRUD operations and index management. including CRUD operations and index management.
You can construct collections directly using the PHP extension's You can construct collections directly using the PHP extension's
``Manager`` class, select a collection from the |php-library|'s :php:`MongoDB\\Driver\\Manager <class.mongodb-driver-manager>` class, select
:phpclass:`MongoDB\\Client` or :phpclass:`MongoDB\\Database` a collection from the |php-library|'s :phpclass:`MongoDB\\Client` or
classes, or create a collection from an existing collection using the :phpclass:`MongoDB\\Database` classes, or create a collection from an
:phpmethod:`withOptions <MongoDB\\Collection::withOptions>` clone method. existing collection using the
:phpmethod:`withOptions() <MongoDB\\Collection::withOptions>` clone method.
:phpclass:`MongoDB\\Collection` supports the :php:`readConcern :phpclass:`MongoDB\\Collection` supports the :php:`readConcern
<mongodb-driver-readconcern>`, :php:`readPreference <mongodb-driver-readconcern>`, :php:`readPreference
<mongodb-driver-readpreference>`, :php:`typeMap <mongodb-driver-readpreference>`, :php:`typeMap
<mongodb.persistence.php#mongodb.persistence.typemaps>`, and <manual/en/mongodb.persistence.deserialization.php#mongodb.persistence.typemaps>`,
:php:`writeConcern <mongodb-driver-writeconcern>` options. and :php:`writeConcern <mongodb-driver-writeconcern>` options.
If you omit an option, the collection inherits the value from the If you omit an option, the collection inherits the value from the
Manager constructor argument or the Database object used to select Manager constructor argument or the Database object used to select
the collection. the collection.
Operations within the ``Collection`` class Operations within the :phpclass:`MongoDB\\Collection` class inherit the
inherit the Collection's options. Collection's options.
The :phpmethod:`MongoDB\\Collection::aggregate` method (when not The :manual:`aggregate </reference/command/aggregate>` (when not using a
using a cursor), :phpmethod:`MongoDB\\Collection::distinct`, and cursor), :manual:`distinct </reference/command/distinct>`, and
:manual:`findAndModify </reference/command/findAndModify>` helpers do not :manual:`findAndModify </reference/command/findAndModify>` helpers do not
support a ``typeMap`` option due to a driver limitation. support a ``typeMap`` option due to a driver limitation. The
:phpmethod:`MongoDB\\Collection::aggregate`, :phpmethod:`aggregate() <MongoDB\\Collection::aggregate>`,
:phpmethod:`MongoDB\\Collection::distinct`, :phpmethod:`distinct() <MongoDB\\Collection::distinct>`,
:phpmethod:`MongoDB\\Collection::findOneAndReplace`, :phpmethod:`findOneAndReplace() <MongoDB\\Collection::findOneAndReplace>`,
:phpmethod:`MongoDB\\Collection::findOneAndUpdate`, and :phpmethod:`findOneAndUpdate() <MongoDB\\Collection::findOneAndUpdate>`, and
:phpmethod:`MongoDB\\Collection::findOneAndDelete` :phpmethod:`findOneAndDelete() <MongoDB\\Collection::findOneAndDelete>`
return BSON documents as `stdClass` objects and arrays as arrays. methods return BSON documents as `stdClass` objects and BSON arrays as
arrays.
Methods Methods
......
...@@ -19,24 +19,22 @@ Definition ...@@ -19,24 +19,22 @@ Definition
Provides methods for common operations on a database, Provides methods for common operations on a database,
such as executing database commands and managing collections. such as executing database commands and managing collections.
You can construct a database directly using the PHP extension's You can construct a database directly using the PHP extension's
``Manager`` class or select a database from the |php-library|'s :php:`MongoDB\\Driver\\Manager <class.mongodb-driver-manager>` class or
:phpclass:`MongoDB\\Client` select a database from the |php-library|'s :phpclass:`MongoDB\\Client` class.
class.
:phpclass:`MongoDB\\Database` supports the :php:`readConcern :phpclass:`MongoDB\\Database` supports the :php:`readConcern
<mongodb-driver-readconcern>`, :php:`readPreference <mongodb-driver-readconcern>`, :php:`readPreference
<mongodb-driver-readpreference>`, :php:`typeMap <mongodb-driver-readpreference>`, :php:`typeMap
<mongodb.persistence.php#mongodb.persistence.typemaps>`, and <manual/en/mongodb.persistence.deserialization.php#mongodb.persistence.typemaps>`,
:php:`writeConcern <mongodb-driver-writeconcern>` options. and :php:`writeConcern <mongodb-driver-writeconcern>` options.
If you omit an option, the database inherits the value from the If you omit an option, the database inherits the value from the
Manager constructor argument or the Client object used to select Manager constructor argument or the Client object used to select
the database. the database.
Operations within the ``Database`` class Operations within the :phpclass:`MongoDB\\Database` class inherit the
:phpmethod:`MongoDB\\Database::command` method Database's options.
inherit the Database's options.
.. _database-methods: .. _database-methods:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment