Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
M
mongo-php-library
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
sinan
mongo-php-library
Commits
13eafc62
Commit
13eafc62
authored
May 12, 2015
by
Jeremy Mikola
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update docs for 0.2
parent
8d08c4a2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
7 deletions
+31
-7
index.md
docs/index.md
+1
-1
usage.md
docs/usage.md
+30
-6
No files found.
docs/index.md
View file @
13eafc62
...
...
@@ -30,7 +30,7 @@ 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=
0.2.x-dev
"
$ composer require "mongodb/mongodb=
^0.2.0
"
## Generated API Docs
...
...
docs/usage.md
View file @
13eafc62
# 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\
Manager`
and a namespace
for the collection. A
[
MongoDB namespace
](
http://docs.mongodb.org/manual/faq/developers/#faq-dev-namespace
)
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 on example of a namespace. A
[
write concern
](
http://docs.mongodb.org/manual/core/write-concern/
)
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 omitted, the Collection will
use the Manager's values as its defaults).
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
##
#
Finding a specific document
```
<?php
...
...
@@ -51,3 +64,14 @@ array(5) {
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.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment