Skip to content

Commit 13eafc6

Browse files
committed
Update docs for 0.2
1 parent 8d08c4a commit 13eafc6

File tree

2 files changed

+31
-7
lines changed

2 files changed

+31
-7
lines changed

docs/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ The preferred method of installing this library is with
3030
[Composer](https://getcomposer.org/) by running the following from your project
3131
root:
3232

33-
$ composer require "mongodb/mongodb=0.2.x-dev"
33+
$ composer require "mongodb/mongodb=^0.2.0"
3434

3535
## Generated API Docs
3636

docs/usage.md

Lines changed: 30 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,33 @@
11
# Usage
22

3+
## Client class
4+
5+
`MongoDB\Client` serves as an entry point for the library and driver. It is
6+
constructed with the same arguments as the driver's `MongoDB\Driver\Manager`
7+
class, which it composes. The Client class provides methods for creating a
8+
Database or Collection class (from the internal manager instance), as well as
9+
top-level operations, such as enumerating and dropping databases.
10+
311
## Collection class
412

513
`MongoDB\Collection` is perhaps the most useful class in this library. It
614
provides methods for common operations on a collection, such as inserting
715
documents, querying, updating, counting, etc.
816

9-
Constructing a `MongoDB\Collection` requires a `MongoDB\Manager` and a namespace
10-
for the collection. A [MongoDB namespace](http://docs.mongodb.org/manual/faq/developers/#faq-dev-namespace)
17+
Constructing a `MongoDB\Collection` requires a `MongoDB\Driver\Manager` and a
18+
namespace for the collection. A [MongoDB namespace](http://docs.mongodb.org/manual/faq/developers/#faq-dev-namespace)
1119
consists of a database name and collection name joined by a dot. `examples.zips`
12-
is on example of a namespace. A [write concern](http://docs.mongodb.org/manual/core/write-concern/)
20+
is one example of a namespace. Through normal use of the library, a Collection
21+
will typically be created via the `selectCollection()` method on the Manager or
22+
Database classes.
23+
24+
A [write concern](http://docs.mongodb.org/manual/core/write-concern/)
1325
and [read preference](http://docs.mongodb.org/manual/core/read-preference/) may
14-
also be provided when constructing a Collection (if omitted, the Collection will
15-
use the Manager's values as its defaults).
26+
also be provided when constructing a Collection. If these options are omitted,
27+
the Collection will inherit them from the parent through which it was selected,
28+
or the Manager.
1629

17-
## Finding a specific document
30+
### Finding a specific document
1831

1932
```
2033
<?php
@@ -51,3 +64,14 @@ array(5) {
5164
string(2) "CA"
5265
}
5366
```
67+
68+
## Database class
69+
70+
`MongoDB\Database` provides methods for common operations on a database, such
71+
as creating, enumerating, and dropping collections.
72+
73+
A [write concern](http://docs.mongodb.org/manual/core/write-concern/)
74+
and [read preference](http://docs.mongodb.org/manual/core/read-preference/) may
75+
also be provided when constructing a Database. If these options are omitted,
76+
the Database will inherit them from the Client through which it was selected,
77+
or the Manager.

0 commit comments

Comments
 (0)