Commit e3b335f7 authored by Jeremy Mikola's avatar Jeremy Mikola

Rewrite documentation for 1.0.0

parent 6ee316a8
...@@ -8,7 +8,7 @@ charset: ...@@ -8,7 +8,7 @@ charset:
main: MongoDB PHP library main: MongoDB PHP library
title: MongoDB PHP library title: MongoDB PHP library
baseUrl: http://mongodb.github.io/mongo-php-library baseUrl: http://mongodb.github.io/mongo-php-library/api
googleCseId: null googleCseId: null
googleAnalytics: null googleAnalytics: null
templateTheme: bootstrap templateTheme: bootstrap
......
# MongoDB\Client
`MongoDB\Client` serves as an entry point for the library and driver. It is
constructed with the same arguments as the driver's `MongoDB\Driver\Manager`
class, which it composes. Additional reference may be found in the
[`MongoDB\Driver\Manager::__construct`](http://php.net/manual/en/mongodb-driver-manager.construct.php])
and
[Connection String](https://docs.mongodb.org/manual/reference/connection-string/)
documentation.
```
/* By default, the driver connects to mongodb://localhost:27017 */
$client = new MongoDB\Client;
/* Any URI options will be merged into the URI string */
$client = new MongoDB\Client(
'mongodb://rs1.example.com,rs2.example.com/?replicaSet=myReplicaSet',
['readPreference' => 'secondaryPreferred']
);
```
Driver options may be provided as the third argument. In addition to options
supported by the extension, the PHP library allows you to specify a default
type map to apply to the cursors it creates. A more thorough description of type
maps may be found in the driver's
[Persistence documentation](http://php.net/manual/en/mongodb.persistence.php#mongodb.persistence.typemaps).
```
/* This example instructs the library to unserialize root and embedded BSON
* documents as PHP arrays, like the legacy driver (i.e. ext-mongo). */
$client = new MongoDB\Client(null, [], [
'typeMap' => ['root' => 'array', 'document' => 'array'],
);
```
By default, the library will unserialize BSON documents and arrays as
`MongoDB\Model\BSONDocument` and `MongoDB\Model\BSONArray` objects,
respectively. Each of these model classes extends PHP's
[`ArrayObject`](http://php.net/arrayobject) class and implements the driver's
[`MongoDB\BSON\Serializable`](http://php.net/mongodb-bson-serializable) and
[`MongoDB\BSON\Unserializable`](http://php.net/mongodb-bson-unserializable)
interfaces.
## Selecting Databases and Collections
The Client class provides methods for creating Database or Collection instances
(using its internal Manager instance). When selecting a Database or Collection,
the child will inherit options (e.g. read preference, type map) from the Client.
New options may also be provided to the `selectDatabase()` and
`selectCollection()` methods.
```
$client = new MongoDB\Client;
/* Select the "demo" database */
$db = $client->selectDatabase('demo');
/* Select the "demo.users" collection */
$collection = $client->selectCollection('demo', 'users');
/* selectDatabase() and selectCollection() also take an options array, which can
* override any options inherited from the Client. */
$db = $client->selectDatabase('demo', [
'readPreference' => new MongoDB\Driver\ReadPreference(MongoDB\Driver\ReadPreference::RP_SECONDARY),
]);
/* The property accessor may also be used to select a database without
* specifying additional options. PHP's complex syntax may be used for selecting
* databases whose names contain special characters (e.g. "-"). */
$db = $client->demo;
$db = $client->{'another-app'};
```
## Database Management
The Client class has several methods for managing databases.
### Dropping Databases
```
$client = new MongoDB\Client;
$result = $client->dropDatabase('demo');
var_dump($result);
```
The above example would output something similar to:
```
object(MongoDB\Model\BSONDocument)#8 (1) {
["storage":"ArrayObject":private]=>
array(2) {
["dropped"]=>
string(4) "demo"
["ok"]=>
float(1)
}
}
```
### Enumerating Databases
```
$client = new MongoDB\Client;
/* listDatabases() returns an iterator of MongoDB\Model\DatabaseInfo objects */
foreach ($client->listDatabases() as $databaseInfo) {
var_dump($databaseInfo);
}
```
The above example would output something similar to:
```
object(MongoDB\Model\DatabaseInfo)#4 (3) {
["name"]=>
string(5) "local"
["sizeOnDisk"]=>
float(65536)
["empty"]=>
bool(false)
}
object(MongoDB\Model\DatabaseInfo)#7 (3) {
["name"]=>
string(4) "test"
["sizeOnDisk"]=>
float(32768)
["empty"]=>
bool(false)
}
```
# MongoDB\Collection
`MongoDB\Collection` is perhaps the most useful class in this library. It
provides methods for common operations on a collection, such as inserting
documents, querying, updating, counting, etc.
A Collection may be constructed directly (using the extension's Manager class)
or selected from the library's Client class. It supports the following options:
* [readConcern](http://php.net/mongodb-driver-readconcern)
* [readPreference](http://php.net/mongodb-driver-readpreference)
* [typeMap](http://php.net/manual/en/mongodb.persistence.php#mongodb.persistence.typemaps)
* [writeConcern](http://php.net/mongodb-driver-writeconcern)
If any options are omitted, they will be inherited from the Manager constructor
argument or object from which the Collection was selected.
Operations within the Collection class (e.g. `find()`, `insertOne()`) will
generally inherit the Collection's options. One notable exception to this rule
is that `aggregate()` (when not using a cursor) and the `findAndModify` variants
do not yet support a type map option due to a driver limitation. This means that
they will return BSON documents and arrays as `stdClass` objects and PHP arrays,
respectively.
## Collection-level Operations
The Collection class has methods for collection-level operations, such as
dropping the collection, CRUD operations, or managing the collection's indexes.
### Dropping the Collection
```
$collection = (new MongoDB\Client)->demo->zips;
$result = $collection->drop();
var_dump($result);
```
The above example would output something similar to:
```
object(MongoDB\Model\BSONDocument)#11 (1) {
["storage":"ArrayObject":private]=>
array(3) {
["ns"]=>
string(9) "demo.zips"
["nIndexesWas"]=>
int(1)
["ok"]=>
float(1)
}
}
```
## CRUD Operations
CRUD is an acronym for Create, Read, Update, and Delete. The Collection class
implements MongoDB's cross-driver
[CRUD specification](https://github.com/mongodb/specifications/blob/master/source/crud/crud.rst),
which defines a common API for collection-level read and write methods.
Each method on the Collection class corresponds to a particular Operation class
within the library. The Collection's method merely merges in relevant options
(e.g. read preferences, type maps). Documentation for each CRUD method and its
options may be found in either the CRUD specification or those Operation
classes.
### API Differences from the Legacy Driver
The CRUD API has some notable differences from the legacy driver's
[MongoCollection](http://php.net/mongocollection) class:
* `insert()` and `batchInsert()` have been renamed to `insertOne()` and
`insertMany()`, respectively.
* `update()` has been split into `updateOne()`, `updateMany()`, and
`replaceOne()`.
* `remove()` has been split into `deleteOne()` and `deleteMany()`.
* `findAndModify()` has been split into `findOneAndDelete()`,
`findOneAndReplace()`, and `findOneAndUpdate()`.
* `save()`, which was syntactic sugar for an insert or upsert operation, has
been removed in favor of explicitly using `insertOne()` or `replaceOne()`
(with the `upsert` option).
* `aggregate()` and `aggregateCursor()` have been consolidated into a single
`aggregate()` method.
* A general-purpose `bulkWrite()` method replaces the legacy driver's
[`MongoWriteBatch`](http://php.net/mongowritebatch) class.
The general rule in designing our new API was that explicit method names were
preferable to overloaded terms found in the old API. For instance, `save()` and
`findAndModify()` had two or three very different modes of operation, depending
on their arguments. These new methods names also distinguish between
[updating specific fields](https://docs.mongodb.org/manual/tutorial/modify-documents/#update-specific-fields-in-a-document)
and [full-document replacement](https://docs.mongodb.org/manual/tutorial/modify-documents/#replace-the-document).
### Finding One or More Document(s)
The `findOne()` and `find()` methods may be used to query for one or multiple
documents.
```
$collection = (new MongoDB\Client)->demo->zips;
$document = $collection->findOne(['_id' => '94301']);
var_dump($document);
```
The above example would output something similar to:
```
object(MongoDB\Model\BSONDocument)#13 (1) {
["storage":"ArrayObject":private]=>
array(5) {
["_id"]=>
string(5) "94301"
["city"]=>
string(9) "PALO ALTO"
["loc"]=>
object(MongoDB\Model\BSONArray)#12 (1) {
["storage":"ArrayObject":private]=>
array(2) {
[0]=>
float(-122.149685)
[1]=>
float(37.444324)
}
}
["pop"]=>
int(15965)
["state"]=>
string(2) "CA"
}
}
```
The `find()` method returns a
[`MongoDB\Driver\Cursor`](http://php.net/mongodb-driver-cursor) object, which
may be iterated upon to access all matched documents.
## Index Management
The Collection class implements MongoDB's cross-driver
[Index Management](https://github.com/mongodb/specifications/blob/master/source/index-management.rst)
and
[Enumerating Indexes](https://github.com/mongodb/specifications/blob/master/source/enumerate-indexes.rst)
specifications, which defines a common API for index-related methods.
### Creating Indexes
```
$collection = (new MongoDB\Client)->demo->zips;
$result = $collection->createIndex(['state' => 1]);
var_dump($result);
```
The above example would output something similar to:
```
string(7) "state_1"
```
### Dropping Indexes
```
$collection = (new MongoDB\Client)->demo->zips;
$result = $collection->dropIndex('state_1');
var_dump($result);
```
The above example would output something similar to:
```
object(MongoDB\Model\BSONDocument)#11 (1) {
["storage":"ArrayObject":private]=>
array(2) {
["nIndexesWas"]=>
int(2)
["ok"]=>
float(1)
}
}
```
### Enumerating Indexes
```
/* listIndexes() returns an iterator of MongoDB\Model\IndexInfo objects */
$collection = (new MongoDB\Client)->demo->zips;
foreach ($collection->listIndexes() as $indexInfo) {
var_dump($indexInfo);
}
```
The above example would output something similar to:
```
object(MongoDB\Model\IndexInfo)#4 (4) {
["v"]=>
int(1)
["key"]=>
array(1) {
["_id"]=>
int(1)
}
["name"]=>
string(4) "_id_"
["ns"]=>
string(9) "demo.zips"
}
```
# MongoDB\Database
`MongoDB\Database` provides methods for common operations on a database, such
as creating, enumerating, and dropping collections.
A Database may be constructed directly (using the extension's Manager class) or
selected from the library's Client class. It supports the following options:
* [readConcern](http://php.net/mongodb-driver-readconcern)
* [readPreference](http://php.net/mongodb-driver-readpreference)
* [typeMap](http://php.net/manual/en/mongodb.persistence.php#mongodb.persistence.typemaps)
* [writeConcern](http://php.net/mongodb-driver-writeconcern)
If any options are omitted, they will be inherited from the Manager constructor
argument or object from which the Database was selected.
Operations within the Database class (e.g. `command()`) will generally inherit
the Database's options.
### Selecting Collections
The Database class provides methods for creating Collection instances (using its
internal Manager instance). When selecting a Collection, the child will inherit
options (e.g. read preference, type map) from the Database. New options may also
be provided to the `selectCollection()` method.
```
$db = (new MongoDB\Client)->demo;
/* Select the "users" collection */
$collection = $db->selectCollection('users');
/* selectCollection() also takes an options array, which can override any
* options inherited from the Database. */
$collection = $client->selectCollection('users', [
'readPreference' => new MongoDB\Driver\ReadPreference(MongoDB\Driver\ReadPreference::RP_SECONDARY),
]);
/* The property accessor may also be used to select a collection without
* specifying additional options. PHP's complex syntax may be used for selecting
* collection whose names contain special characters (e.g. "."). */
$collection = $db->users;
$collection = $db->{'system.profile'};
```
## Database-level Operations
The Database class has methods for database-level operations, such as dropping
the database, executing a command, or managing the database's collections.
### Dropping the Database
```
$db = (new MongoDB\Client)->demo;
$result = $db->drop();
var_dump($result);
```
The above example would output something similar to:
```
object(MongoDB\Model\BSONDocument)#11 (1) {
["storage":"ArrayObject":private]=>
array(2) {
["dropped"]=>
string(4) "demo"
["ok"]=>
float(1)
}
}
```
### Executing a Command
While the library provides helpers for some common database commands, it is far
from an [exhaustive list](https://docs.mongodb.org/manual/reference/command/).
The following example demonstrates how the
[createUser](https://docs.mongodb.org/manual/reference/command/createUser/)
command might be invoked:
```
$db = (new MongoDB\Client)->demo;
/* Define a command document for creating a new database user */
$createUserCmd = [
'createUser' => 'username',
'pwd' => 'password',
'roles' => [ 'readWrite' ],
];
/* It doesn't hurt to specify an explicit read preference for the command, in
* case the Database was created with a different read preference. This isn't
* required for other command helpers, as the library knows which commands might
* require a primary; however, the Database::command() method is generic. */
$cursor = $db->command($createUserCmd, [
'readPreference' => new MongoDB\Driver\ReadPreference(MongoDB\Driver\ReadPreference::RP_PRIMARY),
]);
/* The command result will be the first and only document in the cursor */
var_dump($cursor->toArray()[0]);
```
The above example would output something similar to:
```
object(MongoDB\Model\BSONDocument)#8 (1) {
["storage":"ArrayObject":private]=>
array(1) {
["ok"]=>
float(1)
}
}
```
## Collection Management
The Database class has several methods for managing collections.
### Creating Collections
MongoDB already creates collections implicitly when they are first referenced in
commands (e.g. inserting a document into a new collection); however, collections
may also be explicitly created with specific options. This is useful for
creating
[capped collections](https://docs.mongodb.org/manual/core/capped-collections/),
enabling
[document validation](https://docs.mongodb.org/manual/core/document-validation/),
or supplying storage engine options.
```
$db = (new MongoDB\Client)->demo;
$result = $db->createCollection('users', [
'validator' => [
'username' => ['$type' => 'string'],
'email' => ['$regex' => '@mongodb\.com$'],
],
]);
var_dump($result);
```
The above example would output something similar to:
```
object(MongoDB\Model\BSONDocument)#11 (1) {
["storage":"ArrayObject":private]=>
array(1) {
["ok"]=>
float(1)
}
}
```
### Dropping Collections
```
$db = (new MongoDB\Client)->demo;
$result = $db->dropCollection('users');
var_dump($result);
```
The above example would output something similar to:
```
object(MongoDB\Model\BSONDocument)#11 (1) {
["storage":"ArrayObject":private]=>
array(3) {
["ns"]=>
string(10) "demo.users"
["nIndexesWas"]=>
int(1)
["ok"]=>
float(1)
}
}
```
### Enumerating Collections
The Database class implements MongoDB's
[Enumerating Collections specification](https://github.com/mongodb/specifications/blob/master/source/enumerate-collections.rst).
```
$db = (new MongoDB\Client)->demo;
/* listCollections() returns an iterator of MongoDB\Model\CollectionInfo objects */
foreach ($db->listCollections() as $collectionInfo) {
var_dump($collectionInfo);
}
```
The above example would output something similar to:
```
object(MongoDB\Model\CollectionInfo)#8 (2) {
["name"]=>
string(5) "users"
["options"]=>
array(0) {
}
}
object(MongoDB\Model\CollectionInfo)#13 (2) {
["name"]=>
string(14) "system.profile"
["options"]=>
array(2) {
["capped"]=>
bool(true)
["size"]=>
int(1048576)
}
}
```
# Example Data # Example Data
Usage examples in this documentation will use Some examples in this documentation use example data fixtures from
[zips.json](http://media.mongodb.org/zips.json). This is a dataset comprised of [zips.json](http://media.mongodb.org/zips.json). This is a dataset comprised of
United States postal codes, populations, and geographic locations. United States postal codes, populations, and geographic locations.
Importing the dataset into MongoDB can be done in several ways. The following Importing the dataset into MongoDB can be done in several ways. The following
examples uses the low-level `mongodb` PHP driver: example uses [PHP driver](http://php.net/mongodb) (i.e. `mongodb` extension).
```php ```
<?php $file = 'http://media.mongodb.org/zips.json';
$file = "http://media.mongodb.org/zips.json";
$zips = file($file, FILE_IGNORE_NEW_LINES); $zips = file($file, FILE_IGNORE_NEW_LINES);
$bulk = new MongoDB\Driver\BulkWrite(); $bulk = new MongoDB\Driver\BulkWrite;
foreach ($zips as $string) { foreach ($zips as $string) {
$document = json_decode($string); $document = json_decode($string);
$bulk->insert($document); $bulk->insert($document);
} }
$manager = new MongoDB\Driver\Manager("mongodb://localhost"); $manager = new MongoDB\Driver\Manager('mongodb://localhost');
$result = $manager->executeBulkWrite("examples.zips", $bulk); $result = $manager->executeBulkWrite('demo.zips', $bulk);
printf("Inserted %d documents\n", $result->getInsertedCount()); printf("Inserted %d documents\n", $result->getInsertedCount());
?>
``` ```
Executing this script should yield the following output: Executing this script should yield the following output:
...@@ -39,5 +35,5 @@ You may also import the dataset using the ...@@ -39,5 +35,5 @@ You may also import the dataset using the
command, which is included with MongoDB: command, which is included with MongoDB:
``` ```
$ mongoimport --db examples --collection zips --file zips.json $ mongoimport --db demo --collection zips --file zips.json --drop
``` ```
# Getting Started
### Requirements
Since this library is only a high-level abstraction for the driver, it requires
that the `mongodb` extension be installed:
```
$ pecl install mongodb
$ echo "extension=mongodb.so" >> `php --ini | grep "Loaded Configuration" | sed -e "s|.*:\s*||"`
```
Instructions for installing the `mongodb` extension on HHVM may be found in the
[Installation with HHVM](http://php.net/manual/en/mongodb.tutorial.install.hhvm.php)
article in the driver documentation.
### Installation
The preferred method of installing this library is with
[Composer](https://getcomposer.org/) by running the following from your project
root:
```
$ composer require "mongodb/mongodb=^1.0.0"
```
While not recommended, the package may also be installed manually via source
tarballs attached to
[GitHub releases](https://github.com/mongodb/mongo-php-library/releases).
### Configure Autoloading
Once the library is installed, ensure that your application includes Composer's
autoloader.
```
// This path should point to Composer's autoloader
require_once __DIR__ . "/vendor/autoload.php";
```
More information on this setup may be found in Composer's
[autoloading documentation](https://getcomposer.org/doc/01-basic-usage.md#autoloading).
If you have installed the package manually (e.g. from a source tarball), you
will likely need configure autoloading manually:
* Map the top-level `MongoDB\` namespace to the `src/` directory using your
preferred autoloader implementation
* Manually require the `src/functions.php` file, since PHP does not yet support
function autoloading
# MongoDB PHP Library # MongoDB PHP Library
This library provides a high-level abstraction around the lower-level This library provides a high-level abstraction around the lower-level
[PHP driver](https://github.com/mongodb/mongo-php-driver) (i.e. the `mongodb` [PHP driver](https://php.net/mongodb) (i.e. the `mongodb` extension).
extension).
While the extension provides a limited API for executing commands, queries, and While the extension provides a limited API for executing commands, queries, and
write operations, this library implements an API similar to that of the write operations, this library implements an API similar to that of the
[legacy PHP driver](http://php.net/manual/en/book.mongo.php). It contains [legacy PHP driver](http://php.net/manual/en/book.mongo.php). It contains
abstractions for client, database, and collection objects, and provides methods abstractions for client, database, and collection objects, and provides methods
for CRUD operations and common commands (e.g. index and collection management). for CRUD operations and common commands (e.g. index and collection management).
Support for GridFS is forthcoming.
If you are developing an application with MongoDB, you should consider using If you are developing an application with MongoDB, you should consider using
this library, or another high-level abstraction, instead of the extension alone. this library, or another high-level abstraction, instead of the extension alone.
For further information about the architecture of this library and the `mongodb` For additional information about this library and the ``mongodb`` extension,
extension, see: see the [Architecture Overview](http://php.net/manual/en/mongodb.overview.php)
article in the driver documentation. [Derick Rethans](http://derickrethans.nl/)
has also written a series of blog posts entitled *New MongoDB Drivers for PHP
and HHVM*:
- http://www.mongodb.com/blog/post/call-feedback-new-php-and-hhvm-drivers * [Part One: History](http://derickrethans.nl/new-drivers.html)
* [Part Two: Architecture](http://derickrethans.nl/new-drivers-part2.html)
# Installation ## API Documentation
Since this library is only a high-level abstraction for the driver, it requires Generated API documentation for the library is available at:
that the [`mongodb` extension be installed](http://mongodb.github.io/mongo-php-driver/#installation):
$ pecl install mongodb * [http://mongodb.github.io/mongo-php-library/api](http://mongodb.github.io/mongo-php-library/api)
$ echo "extension=mongodb.so" >> `php --ini | grep "Loaded Configuration" | sed -e "s|.*:\s*||"`
Instructions for installing the `mongodb` extension on HHVM may be found in the
[HHVM driver's README](https://github.com/mongodb/mongo-hhvm-driver/blob/master/README.rst).
The preferred method of installing this library is with
[Composer](https://getcomposer.org/) by running the following from your project
root:
$ composer require "mongodb/mongodb=^1.0.0@beta"
## Generated API Docs
If you are just interested in referencing the API provided by this library, you
can view generated API documentation [here](./api).
## MongoDB Tutorial ## MongoDB Tutorial
...@@ -46,7 +34,7 @@ If you are a new MongoDB user, these links should help you become more familiar ...@@ -46,7 +34,7 @@ If you are a new MongoDB user, these links should help you become more familiar
with MongoDB and introduce some of the concepts and terms you will encounter in with MongoDB and introduce some of the concepts and terms you will encounter in
this documentation: this documentation:
- [Introduction to CRUD operations in MongoDB](http://docs.mongodb.org/manual/core/crud-introduction/) * [Introduction to CRUD operations in MongoDB](http://docs.mongodb.org/manual/core/crud-introduction/)
- [What is a MongoDB document?](http://docs.mongodb.org/manual/core/document/) * [What is a MongoDB document?](http://docs.mongodb.org/manual/core/document/)
- [MongoDB's *dot notation* for accessing document properties](http://docs.mongodb.org/manual/core/document/#dot-notation) * [MongoDB's *dot notation* for accessing document properties](http://docs.mongodb.org/manual/core/document/#dot-notation)
- [ObjectId: MongoDB's document identifier](http://docs.mongodb.org/manual/reference/object-id/) * [ObjectId: MongoDB's document identifier](http://docs.mongodb.org/manual/reference/object-id/)
# Usage
## Client class
`MongoDB\Client` serves as an entry point for the library and driver. It is
constructed with the same arguments as the driver's `MongoDB\Driver\Manager`
class, which it composes. The Client class provides methods for creating a
Database or Collection class (from the internal manager instance), as well as
top-level operations, such as enumerating and dropping databases.
## Collection class
`MongoDB\Collection` is perhaps the most useful class in this library. It
provides methods for common operations on a collection, such as inserting
documents, querying, updating, counting, etc.
Constructing a `MongoDB\Collection` requires a `MongoDB\Driver\Manager` and a
namespace for the collection. A [MongoDB namespace](http://docs.mongodb.org/manual/faq/developers/#faq-dev-namespace)
consists of a database name and collection name joined by a dot. `examples.zips`
is one example of a namespace. Through normal use of the library, a Collection
will typically be created via the `selectCollection()` method on the Manager or
Database classes.
A [write concern](http://docs.mongodb.org/manual/core/write-concern/)
and [read preference](http://docs.mongodb.org/manual/core/read-preference/) may
also be provided when constructing a Collection. If these options are omitted,
the Collection will inherit them from the parent through which it was selected,
or the Manager.
### Finding a specific document
```
<?php
// This path should point to Composer's autoloader
require_once __DIR__ . "/vendor/autoload.php";
$manager = new MongoDB\Driver\Manager("mongodb://localhost:27017");
$collection = new MongoDB\Collection($manager, "examples.zips");
$sunnyvale = $collection->findOne(array("_id" => "94086"));
var_dump($sunnyvale);
?>
```
Executing this script should yield the following output:
```
array(5) {
["_id"]=>
string(5) "94086"
["city"]=>
string(9) "SUNNYVALE"
["loc"]=>
array(2) {
[0]=>
float(-122.023771)
[1]=>
float(37.376407)
}
["pop"]=>
int(56215)
["state"]=>
string(2) "CA"
}
```
## Database class
`MongoDB\Database` provides methods for common operations on a database, such
as creating, enumerating, and dropping collections.
A [write concern](http://docs.mongodb.org/manual/core/write-concern/)
and [read preference](http://docs.mongodb.org/manual/core/read-preference/) may
also be provided when constructing a Database. If these options are omitted,
the Database will inherit them from the Client through which it was selected,
or the Manager.
site_name: "MongoDB PHP library" site_name: "MongoDB PHP library"
site_url: http://mongodb.github.io/mongo-php-library
repo_url: https://github.com/mongodb/mongo-php-library repo_url: https://github.com/mongodb/mongo-php-library
theme: spacelab
theme: readthedocs
pages: pages:
- [index.md, Home] - 'Home': 'index.md'
- [usage.md, Usage] - 'Getting Started': 'getting-started.md'
- [data.md, Example data] - 'Example Data': 'example-data.md'
extra_javascript: - Classes:
- pretty.js - 'Client': 'classes/client.md'
- 'Database': 'classes/database.md'
- 'Collection': 'classes/collection.md'
markdown_extensions:
- smarty
- toc:
permalink: true
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