Commit faafeece authored by Jeremy Mikola's avatar Jeremy Mikola

Revise class documentation and fix references

parent 241707f9
...@@ -15,12 +15,12 @@ Definition ...@@ -15,12 +15,12 @@ Definition
.. phpclass:: MongoDB\\Client .. phpclass:: MongoDB\\Client
Serves as an entry point for the |php-library|. ``MongoDB\Client`` This class serves as an entry point for the |php-library|. It is the
is the preferred class for connecting to a MongoDB server or cluster preferred class for connecting to a MongoDB server or cluster of servers and
of servers and serves as a gateway for accessing individual acts as a gateway for accessing individual databases and collections.
databases and collections. ``MongoDB\Client`` is analogous to the :phpclass:`MongoDB\\Client` is analogous to the driver's
driver's :php:`MongoDB\\Driver\\Manager <mongodb-driver-manager>` :php:`MongoDB\\Driver\\Manager <mongodb-driver-manager>` class, which it
class, which it composes. `composes <https://en.wikipedia.org/wiki/Object_composition>`_.
Methods Methods
------- -------
......
...@@ -18,24 +18,28 @@ Definition ...@@ -18,24 +18,28 @@ 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 driver's
:php:`MongoDB\\Driver\\Manager <class.mongodb-driver-manager>` class, select :php:`MongoDB\\Driver\\Manager <class.mongodb-driver-manager>` class or
a collection from the |php-library|'s :phpclass:`MongoDB\\Client` or select a collection from the library's :phpclass:`MongoDB\\Client` or
:phpclass:`MongoDB\\Database` classes, or create a collection from an :phpclass:`MongoDB\\Database` classes. A collection may also be cloned from
existing collection using the an existing :phpclass:`MongoDB\\Collection` object via the
:phpmethod:`withOptions() <MongoDB\\Collection::withOptions>` clone method. :phpmethod:`withOptions() <MongoDB\\Collection::withOptions>` 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
<manual/en/mongodb.persistence.deserialization.php#mongodb.persistence.typemaps>`, <manual/en/mongodb.persistence.deserialization.php#mongodb.persistence.typemaps>`,
and :php:`writeConcern <mongodb-driver-writeconcern>` options. and :php:`writeConcern <mongodb-driver-writeconcern>` options. If you omit an
If you omit an option, the collection inherits the value from the option, the collection inherits the value from the :php:`Manager
Manager constructor argument or the Database object used to select <mongodb-driver-manager>` constructor argument or the :phpclass:`Client
the collection. <MongoDB\\Client>` or :phpclass:`Database <MongoDB\\Database>` object used to
select the collection.
Operations within the :phpclass:`MongoDB\\Collection` class inherit the Operations within the :phpclass:`MongoDB\\Collection` class inherit the
Collection's options. collection's options.
Type Map Limitations
--------------------
The :manual:`aggregate </reference/command/aggregate>` (when not using a The :manual:`aggregate </reference/command/aggregate>` (when not using a
cursor), :manual:`distinct </reference/command/distinct>`, and cursor), :manual:`distinct </reference/command/distinct>`, and
...@@ -49,7 +53,6 @@ Definition ...@@ -49,7 +53,6 @@ Definition
methods return BSON documents as `stdClass` objects and BSON arrays as methods return BSON documents as `stdClass` objects and BSON arrays as
arrays. arrays.
Methods Methods
------- -------
......
...@@ -15,27 +15,28 @@ Definition ...@@ -15,27 +15,28 @@ Definition
.. phpclass:: MongoDB\\Database .. phpclass:: MongoDB\\Database
Provides methods for common operations on a database, Provides methods for common operations on a database, such as executing
such as executing database commands and managing collections. database commands and managing collections.
You can construct a database directly using the PHP extension's You can construct a database directly using the driver's
:php:`MongoDB\\Driver\\Manager <class.mongodb-driver-manager>` class or :php:`MongoDB\\Driver\\Manager <class.mongodb-driver-manager>` class or
select a database from the |php-library|'s :phpclass:`MongoDB\\Client` class. select a database from the library's :phpclass:`MongoDB\\Client` class. A
database may also be cloned from an existing :phpclass:`MongoDB\\Database`
object via the :phpmethod:`withOptions() <MongoDB\\Database::withOptions>`
method.
: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
<manual/en/mongodb.persistence.deserialization.php#mongodb.persistence.typemaps>`, <manual/en/mongodb.persistence.deserialization.php#mongodb.persistence.typemaps>`,
and :php:`writeConcern <mongodb-driver-writeconcern>` options. and :php:`writeConcern <mongodb-driver-writeconcern>` options. If you omit an
If you omit an option, the database inherits the value from the option, the database inherits the value from the :php:`Manager
Manager constructor argument or the Client object used to select <mongodb-driver-manager>` constructor argument or the :phpclass:`Client
the database. <MongoDB\\Client>` object used to select the database.
Operations within the :phpclass:`MongoDB\\Database` class inherit the Operations within the :phpclass:`MongoDB\\Database` class inherit the
Database's options. Database's options.
.. _database-methods:
Methods Methods
------- -------
......
...@@ -22,11 +22,11 @@ Definition ...@@ -22,11 +22,11 @@ Definition
class provides an interface around these collections for working with the class provides an interface around these collections for working with the
files as PHP :php:`Streams <stream>`. files as PHP :php:`Streams <stream>`.
You can construct a GridFS bucket using the PHP extension's You can construct a GridFS bucket using the driver's
:php:`MongoDB\\Driver\\Manager <class.mongodb-driver-manager>` class, or :php:`Manager <class.mongodb-driver-manager>` class, or select a bucket from
select a bucket from the |php-library|'s :phpclass:`MongoDB\\Database` class the library's :phpclass:`MongoDB\\Database` class via the
via the :phpmethod:`selectGridFSBucket() :phpmethod:`selectGridFSBucket() <MongoDB\\Database::selectGridFSBucket>`
<MongoDB\\Database::selectGridFSBucket>` method. method.
Methods 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