diff --git a/appendices/extensions.xml b/appendices/extensions.xml
index 1f12083846..cd50eb1009 100644
--- a/appendices/extensions.xml
+++ b/appendices/extensions.xml
@@ -81,7 +81,6 @@
-
@@ -331,7 +330,6 @@
-
diff --git a/appendices/ini.list.xml b/appendices/ini.list.xml
index 60e022a5eb..2d12e2cb8f 100644
--- a/appendices/ini.list.xml
+++ b/appendices/ini.list.xml
@@ -554,7 +554,6 @@
PHP_INI_ALL
-
diff --git a/language/context.xml b/language/context.xml
index 91be147467..dca7a61101 100644
--- a/language/context.xml
+++ b/language/context.xml
@@ -20,7 +20,6 @@
&language.context.ssl;
&language.context.curl;
&language.context.phar;
- &language.context.mongodb;
&language.context.parameters;
&language.context.zip;
diff --git a/language/context/mongodb.xml b/language/context/mongodb.xml
deleted file mode 100644
index 559bf3d4ba..0000000000
--- a/language/context/mongodb.xml
+++ /dev/null
@@ -1,158 +0,0 @@
-
-
-
-
-
- MongoDB context options
- MongoDB context option listing
-
-
-
- &reftitle.description;
-
- Context options for mongodb:// transports.
-
-
-
-
- &reftitle.options;
-
-
-
-
- log_cmd_insert
- callable
-
-
-
- A callback function called when inserting a document, see log_cmd_insert.
-
-
-
-
-
- log_cmd_delete
- callable
-
-
-
- A callback function called when deleting a document, see log_cmd_delete.
-
-
-
-
-
- log_cmd_update
- callable
-
-
-
- A callback function called when updating a document, see log_cmd_update.
-
-
-
-
-
- log_write_batch
- callable
-
-
-
- A callback function called when executing a Write Batch, see log_write_batch.
-
-
-
-
-
- log_reply
- callable
-
-
-
- A callback function called when reading a reply from MongoDB, see log_reply.
-
-
-
-
-
- log_getmore
- callable
-
-
-
- A callback function called when retrieving more results from a MongoDB cursor, see log_getmore.
-
-
-
-
-
- log_killcursor
- callable
-
-
-
- A callback function called executing a killcursor opcode, see log_killcursor.
-
-
-
-
-
-
-
-
- &reftitle.changelog;
-
-
-
-
-
- &Version;
- &Description;
-
-
-
-
- pecl/mongo 1.5.0
-
- Added Write API Context options
-
-
-
-
-
-
-
-
-
- &reftitle.seealso;
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/reference/mongo/batch.xml b/reference/mongo/batch.xml
deleted file mode 100644
index 206eae48ec..0000000000
--- a/reference/mongo/batch.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
-
-
- Batch Classes
-
- &reference.mongo.mongowritebatch;
- &reference.mongo.mongoinsertbatch;
- &reference.mongo.mongoupdatebatch;
- &reference.mongo.mongodeletebatch;
-
-
diff --git a/reference/mongo/book.xml b/reference/mongo/book.xml
deleted file mode 100644
index 9929063dfb..0000000000
--- a/reference/mongo/book.xml
+++ /dev/null
@@ -1,43 +0,0 @@
-
-
-
-
- MongoDB driver (legacy)
- Mongo
-
- &reference.mongo.setup;
- &reference.mongo.constants;
-
- &reference.mongo.manual;
- &reference.mongo.core;
- &reference.mongo.types;
- &reference.mongo.gridfs;
- &reference.mongo.batch;
- &reference.mongo.misc;
- &reference.mongo.reference;
- &reference.mongo.exceptions;
- &reference.mongo.changelog;
-
-
-
-
-
diff --git a/reference/mongo/changelog.xml b/reference/mongo/changelog.xml
deleted file mode 100644
index b44b1cb60b..0000000000
--- a/reference/mongo/changelog.xml
+++ /dev/null
@@ -1,125 +0,0 @@
-
-
-
-
- &ChangelogListingTitle;
- &ChangelogListingDescription;
-
-
- MongoDB PHP Driver 1.5.0
-
- It supports all new features for MongoDB 2.6, including:
-
-
- Aggregate can now return a cursor
- Aggregation pipelines can now be explained
- Possible to set maxTimeMS for commands and queries
- Transparent support for the new command-based MongoDB write API
- New MongoWriteBatch classes (using the new MongoDB write API)
- Support for MongoDB Enterprise features (e.g. Kerberos, LDAP, X509)
- Option to tune acceptable server latency for secondary reads (secondaryAcceptableLatencyMS)
-
-
-
- With this release, some driver functionality which was previously
- documented as deprecated will now formally raise deprecation notices. This
- includes:
-
- Instantiating the Mongo class
- Calling MongoCursor::slaveOkay()
- "wtimeout" and "safe" options for MongoCollection write operations
- Manipulating public properties on core classes (such as $collection->w)
-
-
-
-
- No previously deprecated features have been removed.
-
-
-
- Changes in behaviour:
-
- Setting the mongo.native_long INI setting now raises an error on 32-bit
- platforms, and now defaults to true for 64-bit platforms.
-
-
-
-
-
- MongoDB PHP Driver 1.4.0
-
- The 1.4 series introduced fundemental changes in how connections are created to the MongoDB servers.
- The driver now utilizes PHP native streams, so all normal PHP stream options apply.
- Furthermore, an experimental Stream Context Support was added.
-
-
- The 1.4.x series also added support for MongoDB 2.4.x.
-
-
- The most important improvements however deal with the handling of replica sets,
- especially nodes that timeout and nodes that are unreachable for various
- reasons. Besides the improvements to replica set handling, this release
- addresses issues with read preferences through mongos nodes. It also
- adds support for SSL enabled connections as well as journal and fsync
- connection string options.
-
-
-
-
- MongoDB PHP Driver 1.3.0
-
- The 1.3 series introduced several major changes to the extension such as
- completely rewritten connection
- handling (and removal of the pooling mechanism), support for
- ReadPreferences and change the
- default WriteConcerns to be
- acknowledged by introducing a new class
- MongoClient which serves as a
- replacement class for the now deprecated Mongo class.
-
-
- The driver now also supports connecting to multiple mongos instances (the
- Mongo Shard router) for loadbalancing.
-
-
- Other enhancements include improved logging for easier connection handling
- debugging with MongoLog and support for the
- Aggregation Framework
- via the MongoCollection::aggregate method.
-
-
-
-
-
- Changes to existing methods
-
- Following is a list of all improvements to existing methods since
- their inception.
-
-
-
-
-
-
-
-
-
diff --git a/reference/mongo/configure.xml b/reference/mongo/configure.xml
deleted file mode 100644
index 4eb26d3e8f..0000000000
--- a/reference/mongo/configure.xml
+++ /dev/null
@@ -1,302 +0,0 @@
-
-
-
-
- &reftitle.install;
-
-
- &mongo.deprecated.note;
-
-
-
- The MongoDB PHP driver should work on nearly any system: Windows, macOS,
- Unix, and Linux; little- and big-endian machines; 32- and 64-bit machines; PHP
- 5.3 through 5.6 (versions prior to 1.6 also support PHP 5.2).
-
-
- &pecl.moved;
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Manual Installation
-
- For driver developers and people interested in the latest bugfixes, you
- can compile the driver from the latest source code on
- Github.
- Go to Github and click the "download" button. Then run:
-
-
-.tar.gz
-$ cd mongo-php-driver-legacy-
-$ phpize
-$ ./configure
-$ make all
-$ sudo make install
-]]>
-
-
-
-
- Make the following changes to &php.ini;:
-
-
-
-
- Make sure the extension_dir variable is pointing to
- the directory containing mongo.so. The build will display where
- it is installing the PHP driver with output that looks something like:
-
-
-
-
- Make sure that it is the same as the PHP extension directory by running:
-
-
- /usr/lib/php/extensions/no-debug-non-zts-20060613 =>
- /usr/lib/php/extensions/no-debug-non-zts-20060613
-]]>
-
-
- If it's not, change the extension_dir in &php.ini; or
- move mongo.so.
-
-
-
-
- To load the extension on PHP startup, add a line:
-
-
-
-
-
-
-
-
-
-
-
- Installing on *NIX
-
-
- Run:
-
-
-
-
-
-
- Add the following line to your &php.ini; file:
-
-
-
-
-
-
- If pecl runs out of memory while installing, make sure memory_limit in
- &php.ini; is set to at least 128MB.
-
-
-
-
- Installing on Windows
-
-
- Precompiled binaries for each release are available from
- PECL for a variety
- of combinations of versions, thread safety, and VC libraries. Unzip the
- archive and put php_mongo.dll in your PHP extension directory ("ext" by
- default).
-
-
-
- Add the following line to your &php.ini; file:
-
-
-
-
-
-
- Additional DLL dependencies for Windows Users
-
- &ext.windows.path.dll;
- libsasl.dll
-
-
-
-
-
- macOS
-
-
- In most cases installing from PECL is the easiest way:
-
-
-
-
-
-
- If your system has multiple version of PHP installed (e.g. macOS default,
- Homebrew, XAMPP), note that each
- version of PHP has its own pecl
- command and &php.ini; file.
-
-
-
- Xcode dependency for compiling on macOS
-
- Compiling the driver on macOS will require Xcode developer tools, which may
- be installed with xcode-select --install. If that command is
- not available, you may first need to install the
- Command Line Tools package.
-
-
-
-
-
- Gentoo
-
-
- Gentoo has a package for the PHP PECL driver called dev-php/pecl-mongo, which can be
- installed with:
-
-
-
-
-
-
-
- If you use PECL, you may get an error that libtool is the wrong version.
- Compiling from source you'll need to run aclocal and autoconf.
-
-
-
-
-
-
-
-
- Red Hat
-
-
- This includes Fedora and CentOS.
-
-
-
- The default Apache settings on these systems do not let requests make
- network connections, meaning that the driver will get "Permission denied"
- errors when it tries to connect to the database. If you run into this, try
- running:
-
-
-
- Then restart Apache. (This issue has also occurred with SELinux.)
-
-
-
-
- Third-Party Installation Instructions
-
-
- A number of people have created excellent tutorials on installing the PHP
- driver.
-
-
-
-
-
-
- (Re)installing PHP on macOS
-
-
-
- This article by Justin Hileman details the process of installing PHP and
- additional extensions with Homebrew on macOS. This complements the earlier
- instructions on this page for installing the driver with Homebrew.
-
-
-
-
-
- PHP 5.3.1 with Xdebug, MongoDB and Lithium on Ubuntu 9.10 / Apache 2.2
-
-
- This screencast by Jon Adams demonstrates how to quickly get up and
- running with PHP 5.3.1, Xdebug, and MongoDB on Ubuntu 9.10 with Apache.
-
-
-
-
-
-
-
-
-
diff --git a/reference/mongo/connecting.xml b/reference/mongo/connecting.xml
deleted file mode 100644
index 386ee71172..0000000000
--- a/reference/mongo/connecting.xml
+++ /dev/null
@@ -1,775 +0,0 @@
-
-
-
-
- Connecting
-
-
- Connecting to MongoDB can be as easy as new MongoClient,
- but there are many additional options and configurations. The documentation
- for MongoClient::__construct covers all of the API
- options, but this page gives some more details and advice for practical use
- cases.
-
-
-
- Connecting over SSL
-
- The driver supports connecting to MongoDB over SSL
- and can optionally use SSL Stream Context options to provide more details,
- such as verifying certificates against specific certificate chain, or authenticate to
- MongoDB using X509 certificates.
-
-
-
- Connect to MongoDB Instance with SSL Encryption
-
- true));
-?>
-]]>
-
-
-
-
- Connect to MongoDB Instance with SSL Encryption, verifying it is who we think it is
-
- array(
- /* Certificate Authority the remote server certificate must be signed by */
- "cafile" => $SSL_DIR . "/" . $SSL_FILE,
-
- /* Disable self signed certificates */
- "allow_self_signed" => false,
-
- /* Verify the peer certificate against our provided Certificate Authority root certificate */
- "verify_peer" => true, /* Default to false pre PHP 5.6 */
-
- /* Verify the peer name (e.g. hostname validation) */
- /* Will use the hostname used to connec to the node */
- "verify_peer_name" => true,
-
- /* Verify the server certificate has not expired */
- "verify_expiry" => true, /* Only available in the MongoDB PHP Driver */
- ),
-);
-
-$mc = new MongoClient(
- "mongodb://server1",
- array("ssl" => true),
- array("context" => $ctx)
-);
-?>
-]]>
-
-
-
- The "verify_peer_name" is new in PHP 5.6.0. The
- MongoDB driver as of 1.6.5 however has backported this feature into the
- driver itself, so it works with PHP 5.3 and 5.4 too
-
-
-
-
-
-
- Connect to MongoDB Instance that Requires Client Certificates
-
- array(
- "local_cert" => $MYCERT,
- /* If the certificate we are providing was passphrase encoded, we need to set it here */
- "passphrase" => "My Passphrase for the local_cert",
-
- /* Optionally verify the server is who he says he is */
- "cafile" => $SSL_DIR . "/" . $SSL_FILE,
- "allow_self_signed" => false,
- "verify_peer" => true,
- "verify_peer_name" => true,
- "verify_expiry" => true,
- ),
-));
-
-$mc = new MongoClient(
- "mongodb://server1/?ssl=true",
- array(),
- array("context" => $ctx)
-);
-?>
-]]>
-
-
-
-
- Authenticating with X.509 certificates
-
- The username is the certificate subject from the X509, which can be extracted like this:
-
-
-
-
-
- array(
- "local_cert" => "/vagrant/certs/ca-signed-client.pem",
- )
-) );
-
-$mc = new MongoClient(
- 'mongodb://username@server1/?authSource=$external&authMechanism=MONGODB-X509&ssl=true',
- array(),
- array("context" => $ctx)
-);
-?>
-]]>
-
-
- Where username is the certificate subject.
-
-
-
-
- &reftitle.changelog;
-
-
-
-
- &Version;
- &Description;
-
-
-
-
- 1.5.0
-
- Added support for X509 authentication.
-
-
-
- 1.4.0
-
- Added support for connecting to SSL enabled MongoDB.
-
-
-
-
-
-
-
-
-
-
- Authentication
-
- If MongoDB is started with the --auth or
- --keyFile options, you must authenticate before you can do
- any operations with the driver. You may authenticate a connection by
- specifying the username and password in either the connection URI or the
- "username" and "password" options for
- MongoClient::__construct.
-
-
- Authenticating against the "admin" database
-
- $username, "password" => $password));
-?>
-]]>
-
-
-
- By default, the driver will authenticate against the admin
- database. You may authenticate against a different database by specifying it
- in either the connection URI or the "db" option for
- MongoClient::__construct.
-
-
- Authenticating against normal databases
-
- "myDatabase"));
-?>
-]]>
-
-
-
- If your connection is dropped, the driver will automatically attempt to
- reconnect and reauthenticate you.
-
-
-
-
- Replica Sets
-
- To connect to a replica set, specify one or more members of the set and use
- the "replicaSet" option. Multiple servers may be delimited
- by a comma.
-
-
- ReplicaSet seed list
-
- "myReplSetName"));
-
-// Using multiple servers as the seed list
-$m = new MongoClient("mongodb://rs1.example.com:27017,rs2.example.com:27017", array("replicaSet" => "myReplSetName"));
-?>
-]]>
-
-
-
- The PHP driver will query the database server(s) listed to determine the
- primary. So long as it can connect to at least one host listed and find a
- primary, the connection will succeed. If it cannot make a connection to any
- servers listed or cannot find a primary, a
- MongoConnectionException will be thrown.
-
-
-
- You should always provide a seed list with more than one member of the
- ReplicaSet. For highest availability you should seed with at least one
- server from each of your datacenters.
-
-
-
-
- The host names that you specify in the seed list must
- match the host names in the replica set configuration. This is because the
- driver only uses the host names in the replica set configuration to create
- the hash for its persistent connections.
-
-
- For example, if an IP address is used in the seed list and the replica set
- is configured with host names, the driver will discard any seed list
- connection(s) that differ from the canonical host names reported by the
- replica set. Effectively, these non-canonical seed list connections will be
- recreated on each request, greatly reducing the benefit of using persistent
- connections.
-
-
-
-
- The driver does not support connecting to different
- replica sets with the same name. This extends beyond one script so make
- sure to have separate names for each of your replica sets. That also means
- that you can not do this:
-
-
- Wrong replica set name duplication
-
-
-]]>
-
-
-
- Instead, you need to have two different names for your replica sets:
-
-
- Correct use of two replica set names
-
-
-]]>
-
-
-
-
- If the primary becomes unavailable, an election will take place and a
- secondary will be promoted to the role of primary (unless a majority vote
- cannot be established). During this time
- (20-60 seconds), the
- connection will not be able to perform any write operations and attempts to
- do so will result in an exception. Connections to secondaries will still be
- able to perform reads.
-
-
-
- The default Read Preference
- is to only read from the primary. During the election process there is no
- primary, and all read will therefore fail.
-
-
- It is recommended to use
- MongoClient::RP_PRIMARY_PREFERRED Read Preference for
- applications that require high availability for reads, as reads will only
- be executed on the secondaries when there simply isn't a primary
- available.
-
-
-
- Once a primary is elected, attempting to perform a read or write will allow
- the driver to detect the new primary. The driver will make this its primary
- database connection and continue operating normally.
-
-
- The health and state of a secondary is checked every 5 seconds
- (configurable with
- mongo.ping_interval)
- or when the next operation occurs after 5 seconds. It will also recheck
- the configuration when the driver has a problem reaching a server.
-
-
- Replica set failovers are checked every 60 seconds (configurable with
- mongo.is_master_interval),
- and whenever a write operation fails when using acknowledged writes.
-
-
-
-
- Secondaries may be behind the primary in operations, so
- your application must be able to handle out-of-date data when using
- Read Preferences other then MongoClient::RP_PRIMARY.
-
-
-
-
- For more information on replica sets, see the
- core documentation.
-
-
-
- &reftitle.seealso;
-
-
-
-
-
-
-
- &reftitle.changelog;
-
-
-
-
- &Version;
- &Description;
-
-
-
-
- 1.0.9
-
- Added support for connecting to ReplicaSet and automatic failover.
-
-
-
-
-
-
-
-
-
-
- Sharding
-
- To connect to a shard cluster, specify the address of one or more
- mongos instances in the connection string. Multiple
- servers may be delimited by a comma.
-
-
-
-
-]]>
-
-
-
- Regardless of whether each shard is a stand-alone mongod
- server or a full replica set, the driver's connection process is the same.
- All database communication will be routed through mongos.
-
-
- For more information on sharding with MongoDB, see the
- sharding documentation.
-
-
-
-
- Domain Socket Support
-
-
- MongoDB has built-in support for connecting via Unix Domain Sockets and will
- open the socket on startup. By default, the socket is located in
- /tmp/mongodb-<port>.sock.
-
-
-
- To connect to the socket file, specify the path in your MongoDB connection
- string:
-
-
-
-
-
-]]>
-
-
-
-
- If you would like to authenticate against a database (as described above)
- with a socket file, you must specify a port of 0 so that
- the connection string parser can detect the end of the socket path.
- Alternatively, you can use the constructor options.
-
-
-
-
-
-]]>
-
-
-
-
- &reftitle.changelog;
-
-
-
-
- &Version;
- &Description;
-
-
-
-
- 1.0.9
-
- Added support for Unix Domain Sockets.
-
-
-
-
-
-
-
-
-
-
- Persistent Connections (version 1.3.0+)
-
-
- All versions of the driver since 1.3.0 utilize persistent connections to
- minimize the number of connections made to each database server. These
- connections are saved by the PHP worker process and may be reused between
- multiple requests.
-
-
-
- Before connecting to a database server, the driver will create a hash for the
- connection based on its host, port, replica set name (if any), any
- authentication credentials (e.g. username, password, database), and the
- process ID. If a connection already exists for that hash, it will be used in
- lieu of creating a new connection associated with that hash.
- MongoClient::getConnections may be used to retrieve info
- about each persistent connection. Consider the following program:
-
-
-
-
-
-]]>
-
- &example.outputs.similar;
-
-
-
-
-
-
- In this example $m1 and $m2 have the
- same hash and share a persistent connection. Connections for each other
- MongoClient instance hash to unique values and use their own sockets. Note
- that "localhost" and "127.0.0.1" do not share the same hash; DNS resolution
- is not taken into account.
-
-
-
-
- Connection Pooling (version 1.2.0-1.2.12 *only*)
-
-
- This section is no longer relevant as of the 1.3.0 release of the driver
- and only serves as a historical information on how the pooling used to
- work.
-
-
- The latest versions of the driver have no concept of pooling anymore and
- will maintain only one connection per process, for each connection type
- (ReplicaSet/standalone/mongos), for each credentials combination.
-
-
-
- Creating connections is one of the most heavyweight things that the driver
- does. It can take hundreds of milliseconds to set up a connection correctly,
- even on a fast network. Thus, the driver tries to minimize the number of new
- connections created by reusing connections from a pool.
-
-
- When a user creates a new instance of MongoClient, all
- necessary connections will be taken from their pools (replica sets may
- require multiple connections, one for each member of the set). When the
- MongoClient instance goes out of scope, the
- connections will be returned to the pool. When the PHP process exits, all
- connections in the pools will be closed.
-
-
- "Why do I have so many open connections?"
-
- Connection pools can generate a large number of connections. This is
- expected and, using a little arithmetic, you can figure out how many
- connections will be created. There are three factors in determining the
- total number of connections:
-
-
-
-
-
- connections_per_pool
-
-
-
- Each connection pool will create, by default, an unlimited number of
- connections. One might assume that this is a problem: if it can create an
- unlimited number of connections, couldn't it create thousands and the
- server would run out of file descriptors? In practice, this is unlikely,
- as unused connections are returned to the pool to be used later, so future
- connections will use the same connection instead of creating a new one.
- Unless you create thousands of connections at once without letting any go
- out of scope, the number of connections open should stay at a reasonable
- number.
-
-
- You can see how many connections you have in a pool using the
- MongoPool::info function. Add up the "in use" and
- "in pool" fields for a given server. That is the total number of
- connections for that pool.
-
-
-
-
-
- pools_per_process
-
-
-
- Each MongoDB server address you're connecting to gets its own connection
- pool. For example, if your local hostname is "example.net", connecting
- to "example.net:27017", "localhost:27017", and "/tmp/mongodb-27017.sock"
- will create three connection pools. You can see how many connection pools
- you have open using MongoPool::info.
-
-
-
-
-
- processes
-
-
-
- Each PHP process has a separate set of pools. PHP-FPM and Apache
- generally create between 6 and a couple of dozen PHP worker children.
- Check your settings to see what the max number of PHP processes is that
- can be spawned.
-
-
- If you are using PHP-FPM, estimating the number of connections can be
- tricky because it will spawn more PHP-FPM workers under heavy load. To be
- on the safe side, look at the max_children parameter or
- add up spare_servers + start_servers
- (choose whichever number is higher). That will indicate how many PHP
- processes (i.e. sets of pools) you should plan for.
-
-
-
-
- The three variables above can be multiplied together to give the max
- number of connections expected:
- connections_per_pool *
- pools_per_process *
- processes. Note that
- connections_per_pool can be different for different
- pools, so connections_per_pool should be the max.
-
-
- For example, suppose we're getting 30 connections per pool, 10 pools per PHP
- process, and 128 PHP processes. Then we can expect 38400 connections from
- this machine. Thus, we should set this machine's file descriptor limit to
- be high enough to handle all of these connections or it may run out of file
- descriptors.
-
-
- See MongoPool for more information on connection
- pooling.
-
-
-
-
-
- Manually Persistent Connections (version up to 1.1.4 *only*)
-
-
- This section is not relevant for 1.2.0+. In 1.2.0+, connections are always
- persistent and managed automatically by the driver. If you are using a
- 1.2.x release (but not 1.3.x or later), see
- MongoPool for more information on pooling.
-
-
-
-
- Creating new connection to the database is very slow. To minimize the number
- of connections that you need to make, you can use persistent connections. A
- persistent connection is saved by PHP, so you can use the same connection for
- multiple requests.
-
-
-
- For example, this simple program connects to the database 1000 times:
-
-
-
-
-
-]]>
-
-
-
-
- It takes approximately 18 seconds to execute. If we change it to use a
- persistent connection:
-
-
-
-
- "x"));
-}
-
-?>
-]]>
-
-
-
-
- ...it takes less than .02 seconds to execute, as it only makes one database
- connection.
-
-
-
- Persistent connections need an identifier string (which is "x" in the above
- example) to uniquely identify them. For a persistent connection to be used,
- the hostname, port, persist string, and authentication credentials (username,
- password and database, if given) must match an existing persistent
- connection. Otherwise, a new connection will be created with this identifying
- information.
-
-
- Persistent connections are highly recommended and should
- always be used in production unless there is a compelling reason not to.
- Most of the reasons that they are not recommended for relational databases
- are irrelevant to MongoDB.
-
-
-
-
-
-
diff --git a/reference/mongo/constants.xml b/reference/mongo/constants.xml
deleted file mode 100644
index 2e881f878a..0000000000
--- a/reference/mongo/constants.xml
+++ /dev/null
@@ -1,299 +0,0 @@
-
-
-
-
- &reftitle.constants;
- &extension.constants;
-
-
-
-
- MONGO_STREAMS
- (int)
-
-
-
- Alias of MONGO_SUPPORTS_STREAMS
-
-
-
-
-
- MONGO_SUPPORTS_STREAMS
- (int)
-
-
-
- 1 when compiled against PHP Streams (default since 1.4.0).
-
-
-
-
-
- MONGO_SUPPORTS_SSL
- (int)
-
-
-
- 1 when is enabled and available.
-
-
-
-
-
- MONGO_SUPPORTS_AUTH_MECHANISM_MONGODB_CR
- (int)
-
-
-
- 1 when MongoDB-Challenge/Reponse authentication is compiled in.
-
-
-
-
-
- MONGO_SUPPORTS_AUTH_MECHANISM_MONGODB_X509
- (int)
-
-
-
- 1 when x.509 authentication is compiled in.
-
-
-
-
-
- MONGO_SUPPORTS_AUTH_MECHANISM_GSSAPI
- (int)
-
-
-
- 1 when GSSAPI authentication is compiled in.
-
-
-
-
-
- MONGO_SUPPORTS_AUTH_MECHANISM_PLAIN
- (int)
-
-
-
- 1 when PLAIN authentication is compiled in.
-
-
-
-
-
- MONGO_STREAM_NOTIFY_TYPE_IO_INIT
- (int)
-
-
-
-
-
-
-
-
- MONGO_STREAM_NOTIFY_TYPE_LOG
- (int)
-
-
-
-
-
-
-
-
- MONGO_STREAM_NOTIFY_IO_READ
- (int)
-
-
-
-
-
-
-
-
- MONGO_STREAM_NOTIFY_IO_WRITE
- (int)
-
-
-
-
-
-
-
-
- MONGO_STREAM_NOTIFY_IO_PROGRESS
- (int)
-
-
-
-
-
-
-
-
- MONGO_STREAM_NOTIFY_IO_COMPLETED
- (int)
-
-
-
-
-
-
-
-
- MONGO_STREAM_NOTIFY_LOG_INSERT
- (int)
-
-
-
-
-
-
-
-
- MONGO_STREAM_NOTIFY_LOG_QUERY
- (int)
-
-
-
-
-
-
-
-
- MONGO_STREAM_NOTIFY_LOG_UPDATE
- (int)
-
-
-
-
-
-
-
-
- MONGO_STREAM_NOTIFY_LOG_DELETE
- (int)
-
-
-
-
-
-
-
-
- MONGO_STREAM_NOTIFY_LOG_GETMORE
- (int)
-
-
-
-
-
-
-
-
- MONGO_STREAM_NOTIFY_LOG_KILLCURSOR
- (int)
-
-
-
-
-
-
-
-
- MONGO_STREAM_NOTIFY_LOG_BATCHINSERT
- (int)
-
-
-
-
-
-
-
-
- MONGO_STREAM_NOTIFY_LOG_RESPONSE_HEADER
- (int)
-
-
-
-
-
-
-
-
- MONGO_STREAM_NOTIFY_LOG_WRITE_REPLY
- (int)
-
-
-
-
-
-
-
-
- MONGO_STREAM_NOTIFY_LOG_CMD_INSERT
- (int)
-
-
-
-
-
-
-
-
- MONGO_STREAM_NOTIFY_LOG_CMD_UPDATE
- (int)
-
-
-
-
-
-
-
-
- MONGO_STREAM_NOTIFY_LOG_CMD_DELETE
- (int)
-
-
-
-
-
-
-
-
- MONGO_STREAM_NOTIFY_LOG_WRITE_BATCH
- (int)
-
-
-
-
-
-
-
-
-
-
-
diff --git a/reference/mongo/context.xml b/reference/mongo/context.xml
deleted file mode 100644
index 94f7d6ee7d..0000000000
--- a/reference/mongo/context.xml
+++ /dev/null
@@ -1,64 +0,0 @@
-
-
-
-
- Stream Context Options
-
-
-
- The PHP MongoDB extension provides Stream Context Support
- using the mongodb context.
-
-
-
- A stream context must be created with stream_context_create and passed to the MongoClient::__construct before the actual connection to MongoDB is made.
- It is not possible to apply a stream context to already created streams.
-
-
-
- Additional context options and parameters, such as ssl
- and notification parameters, are also supported.
-
-
-
- The MongoDB context options provide a rich interface to log network traffic between the driver and the MongoDB servers.
- This interface can be used to provide query logging, profiler, debuggers, or anything that would need to inspect the underlaying
- commands and protocol options.
-
-
-
- &reftitle.seealso;
-
-
-
-
-
-
-
-
-
- &reference.mongo.entities.context;
-
-
-
-
-
diff --git a/reference/mongo/context/log-cmd-delete.xml b/reference/mongo/context/log-cmd-delete.xml
deleted file mode 100644
index b41abbfdcb..0000000000
--- a/reference/mongo/context/log-cmd-delete.xml
+++ /dev/null
@@ -1,114 +0,0 @@
-
-
-
-
-
- log_cmd_delete
- Callback When Deleting Documents
-
-
-
- &reftitle.description;
-
- log_cmd_delete
- arrayserver
- arraywriteOptions
- arraydeleteOptions
- arrayprotocolOptions
-
-
- A callable function, used by the
- log_cmd_delete context option,
- when deleteing a document
-
-
-
- This is not a real function, only a prototype of how the function should
- be.
-
-
-
-
-
- &reftitle.parameters;
-
- &mongo.context.server;
- &mongo.context.writeoptions;
-
-
- deleteOptions
-
-
-
-
-
-
-
- key
- value
-
-
-
-
- limit
- integer, 1 or 0. If 0, delete all matching documents.
-
-
- q
- Array, the search criteria
-
-
-
-
-
-
-
- &mongo.context.protocoloptions;
-
-
-
-
- &reftitle.changelog;
-
-
-
-
- &Version;
- &Description;
-
-
-
-
- PECL mongo 1.5.0
-
- Only available when connected to MongoDB 2.6.0+
-
-
-
-
-
-
-
-
-
-
-
diff --git a/reference/mongo/context/log-cmd-insert.xml b/reference/mongo/context/log-cmd-insert.xml
deleted file mode 100644
index 710289f3ff..0000000000
--- a/reference/mongo/context/log-cmd-insert.xml
+++ /dev/null
@@ -1,95 +0,0 @@
-
-
-
-
-
- log_cmd_insert
- Callback When Inserting Documents
-
-
-
- &reftitle.description;
-
- log_cmd_insert
- arrayserver
- arraydocument
- arraywriteOptions
- arrayprotocolOptions
-
-
- A callable function, used by the
- log_cmd_insert context option,
- when inserting a document
-
-
-
- This is not a real function, only a prototype of how the function should
- be.
-
-
-
-
-
- &reftitle.parameters;
-
- &mongo.context.server;
-
-
- document
-
-
-
- The document that has been prepared to be inserted
-
-
-
- &mongo.context.writeoptions;
- &mongo.context.protocoloptions;
-
-
-
-
- &reftitle.changelog;
-
-
-
-
- &Version;
- &Description;
-
-
-
-
- PECL mongo 1.5.0
-
- Only available when connected to MongoDB 2.6.0+
-
-
-
-
-
-
-
-
-
-
-
diff --git a/reference/mongo/context/log-cmd-update.xml b/reference/mongo/context/log-cmd-update.xml
deleted file mode 100644
index 8949429ed7..0000000000
--- a/reference/mongo/context/log-cmd-update.xml
+++ /dev/null
@@ -1,122 +0,0 @@
-
-
-
-
-
- log_cmd_update
- Callback When Updating Documents
-
-
-
- &reftitle.description;
-
- log_cmd_update
- arrayserver
- arraywriteOptions
- arrayupdateOptions
- arrayprotocolOptions
-
-
- A callable function, used by the
- log_cmd_update context option,
- when updateing a document
-
-
-
- This is not a real function, only a prototype of how the function should
- be.
-
-
-
-
-
- &reftitle.parameters;
-
- &mongo.context.server;
- &mongo.context.writeoptions;
-
-
- updateOptions
-
-
-
-
-
-
-
- key
- value
-
-
-
-
- multi
- Boolean, true if this update is allowed to update all matched criteria
-
-
- upsert
- Boolean, true if the document should be created if criteria does not match
-
-
- q
- Array, the search criteria
-
-
- u
- Array, the new object/modifications
-
-
-
-
-
-
-
- &mongo.context.protocoloptions;
-
-
-
-
- &reftitle.changelog;
-
-
-
-
- &Version;
- &Description;
-
-
-
-
- PECL mongo 1.5.0
-
- Only available when connected to MongoDB 2.6.0+
-
-
-
-
-
-
-
-
-
-
-
diff --git a/reference/mongo/context/log-getmore.xml b/reference/mongo/context/log-getmore.xml
deleted file mode 100644
index 537e0327ad..0000000000
--- a/reference/mongo/context/log-getmore.xml
+++ /dev/null
@@ -1,91 +0,0 @@
-
-
-
-
-
- log_getmore
- Callback When Retrieving Next Cursor Batch
-
-
-
- &reftitle.description;
-
- log_getmore
- arrayserver
- arrayinfo
-
-
- A callable function, used by the
- log_getmore context option,
- when executing a GET_MORE operation.
-
-
-
- This is not a real function, only a prototype of how the function should
- be.
-
-
-
-
-
- &reftitle.parameters;
-
- &mongo.context.server;
-
-
- info
-
-
-
-
-
-
-
- key
- value
-
-
-
-
- request_id
- integer, the driver request identifier
-
-
- cursor_id
- integer, the cursor identifier being used to fetch more data
-
-
- batch_size
- integer, maximum number of documents being requested
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/reference/mongo/context/log-killcursor.xml b/reference/mongo/context/log-killcursor.xml
deleted file mode 100644
index 1d0e649b99..0000000000
--- a/reference/mongo/context/log-killcursor.xml
+++ /dev/null
@@ -1,83 +0,0 @@
-
-
-
-
-
- log_killcursor
- Callback When Executing KILLCURSOR operations
-
-
-
- &reftitle.description;
-
- log_killcursor
- arrayserver
- arrayinfo
-
-
- A callable function, used by the
- log_killcursor context option,
- when reading a killcursor from MongoDB.
-
-
-
- This is not a real function, only a prototype of how the function should
- be.
-
-
-
-
-
- &reftitle.parameters;
-
- &mongo.context.server;
-
-
- info
-
-
-
-
-
-
-
- key
- value
-
-
-
-
- cursor_id
- integer, the cursor identifier to kill
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/reference/mongo/context/log-reply.xml b/reference/mongo/context/log-reply.xml
deleted file mode 100644
index cd775e5e36..0000000000
--- a/reference/mongo/context/log-reply.xml
+++ /dev/null
@@ -1,141 +0,0 @@
-
-
-
-
-
- log_reply
- Callback When Reading the MongoDB reply
-
-
-
- &reftitle.description;
-
- log_reply
- arrayserver
- arraymessageHeaders
- arrayoperationHeaders
-
-
- A callable function, used by the
- log_reply context option,
- when reading a reply from MongoDB.
-
-
-
- This is not a real function, only a prototype of how the function should
- be.
-
-
-
-
-
- &reftitle.parameters;
-
- &mongo.context.server;
-
-
- messageHeaders
-
-
-
-
-
-
-
- key
- value
-
-
-
-
- length
- integer, bytes, message reply length
-
-
- request_id
- integer, the server request identifier
-
-
- response_id
- integer, the driver request identifier this message is a response of
-
-
- opcode
- integer, the opcode id
-
-
-
-
-
-
-
-
-
- operationHeaders
-
-
-
-
-
-
-
- key
- value
-
-
-
-
- flags
- integer, bitmask of protocol flags
-
-
- cursor_id
- integer, ID of the cursor created on the server (0 if none created, or its been exhausted)
-
-
- start
- The starting offset of this cursor
-
-
- returned
- integer, how many documents are returned in this trip
-
-
-
-
-
-
-
-
-
-
-
- &reftitle.seealso;
-
- The OP_REPLY definition in the Wire Protocol
-
-
-
-
-
-
-
diff --git a/reference/mongo/context/log-write-batch.xml b/reference/mongo/context/log-write-batch.xml
deleted file mode 100644
index d227e7ec21..0000000000
--- a/reference/mongo/context/log-write-batch.xml
+++ /dev/null
@@ -1,95 +0,0 @@
-
-
-
-
-
- log_write_batch
- Callback When Writing Batches
-
-
-
- &reftitle.description;
-
- log_write_batch
- arrayserver
- arraywriteOptions
- arraybatch
- arrayprotocolOptions
-
-
- A callable function, used by the
- log_write_batch context option,
- when executing a batch operation.
-
-
-
- This is not a real function, only a prototype of how the function should
- be.
-
-
-
-
-
- &reftitle.parameters;
-
- &mongo.context.server;
- &mongo.context.writeoptions;
-
-
- batch
-
-
-
- Array, the actual batch operation.
-
-
-
- &mongo.context.protocoloptions;
-
-
-
-
- &reftitle.changelog;
-
-
-
-
- &Version;
- &Description;
-
-
-
-
- PECL mongo 1.5.0
-
- Only available when connected to MongoDB 2.6.0+
-
-
-
-
-
-
-
-
-
-
-
diff --git a/reference/mongo/core.xml b/reference/mongo/core.xml
deleted file mode 100644
index 75b2b584e7..0000000000
--- a/reference/mongo/core.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-
-
-
-
-
- Core Classes
-
-
- &mongo.deprecated.note;
-
-
- The core classes are the most important part of the driver.
-
-
-
- &reference.mongo.mongoclient;
- &reference.mongo.mongodb;
- &reference.mongo.mongocollection;
- &reference.mongo.mongocursor;
- &reference.mongo.mongocursorinterface;
- &reference.mongo.mongocommandcursor;
-
-
diff --git a/reference/mongo/exceptions.xml b/reference/mongo/exceptions.xml
deleted file mode 100644
index a33b604ed6..0000000000
--- a/reference/mongo/exceptions.xml
+++ /dev/null
@@ -1,45 +0,0 @@
-
-
-
-
-
- Exceptions
-
-
-
- VMWare Oddities
-
- If you are running VMWare on Windows and are using CIFS, pausing the VM will
- cause CIFS to go out of sync and cause weird errors on un-pausing it ("The
- Mongo object has not been correctly initialized by its constructor").
- Permanently mounting the Windows shares will fix this and you'll be able to
- pause and unpause at will.
-
-
- To permanently mount the Windows shares, run:
-
-
-
-
-
- See the Ubuntu docs for the most
- up-to-date instructions.
-
-
-
-
- &reference.mongo.mongoexception;
- &reference.mongo.mongoresultexception;
- &reference.mongo.mongocursorexception;
- &reference.mongo.mongocursortimeoutexception;
- &reference.mongo.mongoconnectionexception;
- &reference.mongo.mongogridfsexception;
- &reference.mongo.mongoduplicatekeyexception;
- &reference.mongo.mongoprotocolexception;
- &reference.mongo.mongoexecutiontimeoutexception;
- &reference.mongo.mongowriteconcernexception;
-
-
diff --git a/reference/mongo/functions/bson-decode.xml b/reference/mongo/functions/bson-decode.xml
deleted file mode 100644
index 1d0d32af4c..0000000000
--- a/reference/mongo/functions/bson-decode.xml
+++ /dev/null
@@ -1,66 +0,0 @@
-
-
-
-
- bson_decode
- Deserializes a BSON object into a PHP array
-
-
-
- &reftitle.description;
-
- arraybson_decode
- stringbson
-
-
- This function is very beta and entirely useless for 99% of users. It is only
- useful if you're doing something weird, such as writing your own driver on
- top of the PHP driver.
-
-
-
-
- &reftitle.parameters;
-
-
-
- bson
-
-
- The BSON to be deserialized.
-
-
-
-
-
-
-
-
- &reftitle.returnvalues;
-
- Returns the deserialized BSON object.
-
-
-
-
-
-
diff --git a/reference/mongo/functions/bson-encode.xml b/reference/mongo/functions/bson-encode.xml
deleted file mode 100644
index 75bac9f80f..0000000000
--- a/reference/mongo/functions/bson-encode.xml
+++ /dev/null
@@ -1,66 +0,0 @@
-
-
-
-
- bson_encode
- Serializes a PHP variable into a BSON string
-
-
-
- &reftitle.description;
-
- stringbson_encode
- mixedanything
-
-
- This function is very beta and entirely useless for 99% of users. It is only
- useful if you're doing something weird, such as writing your own driver on
- top of the PHP driver.
-
-
-
-
- &reftitle.parameters;
-
-
-
- anything
-
-
- The variable to be serialized.
-
-
-
-
-
-
-
-
- &reftitle.returnvalues;
-
- Returns the serialized string.
-
-
-
-
-
-
diff --git a/reference/mongo/gridfs.xml b/reference/mongo/gridfs.xml
deleted file mode 100644
index 9397d5114b..0000000000
--- a/reference/mongo/gridfs.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
-
- GridFS Classes
-
- &reference.mongo.mongogridfs;
- &reference.mongo.mongogridfsfile;
- &reference.mongo.mongogridfscursor;
-
-
diff --git a/reference/mongo/ini.xml b/reference/mongo/ini.xml
deleted file mode 100644
index dd88a8ac78..0000000000
--- a/reference/mongo/ini.xml
+++ /dev/null
@@ -1,340 +0,0 @@
-
-
-
- &reftitle.runtime;
- &extension.runtime;
-
-
- &ini.php.constants;
-
-
- &ini.descriptions.title;
-
-
-
-
-
- mongo.allow_empty_keys
- int
-
-
-
- Added in version 1.0.11.
-
-
- If empty strings ("") should be allowed as key names. By default, the
- driver will throw an exception if you attempt to pass the empty string as
- a key to the database. It is extremely easy to do this inavertently by
- using double quotes with $-operators, so it is recommended that you leave
- this setting as default. However, if you need to save keys that are empty
- strings, you can set this option to true and the driver will allow you to
- pass empty strings to the database.
-
-
-
-
-
-
- mongo.allow_persistent
- int
-
-
-
- If persistent connections are allowed. (Removed in 1.2.0 - all
- connections are now persistent).
-
-
-
-
-
-
- mongo.chunk_size
- int
-
-
-
- The number of bytes-per-chunk. Used in divvying up GridFS files. This
- number must be at least 100 less than 4 megabytes (max: 4194204) and it is
- recommended that it be less than that.
-
-
-
-
-
-
- mongo.cmd
- string
-
-
-
- A character to be used in place of $ in modifiers and comparisons.
-
-
- As it is easy to forget to escape the "$", you can also choose your own
- special character to use instead of '$'. Choose a character that will not
- occur in your key names, e.g. ":":
-
-
-
-
-
- Then, to do a comparison, for example:
-
-
- array( ":gt" => 20, ":lte" => 30 ) );
-
-?>
-]]>
-
-
- You can also change it in your code using
- ini_set("mongo.cmd", ":"). Of course, you can also
- just use single quotes or backslash-escape the $.
-
-
-
-
-
-
- mongo.default_host
- string
-
-
-
- Default hostname when nothing is passed to the constructor.
-
-
-
-
-
-
- mongo.default_port
- string
-
-
-
- The default TCP port number to use when connecting to the database server
- if no other port is specified. The database's default is
- 27017.
-
-
-
-
-
-
- mongo.is_master_interval
- int
-
-
-
- Added in version 1.2.10.
-
-
- For replicaset connections: The minimum interval with which the driver
- will send "isMaster" requests to the MongoDB server. If the value is lower,
- there will be more requests, but the driver finds faster whether the
- topology of the replicaset has been changed.
-
-
-
-
-
-
- mongo.long_as_object
- int
-
-
-
- Return a BSON_LONG as an instance of MongoInt64
- (instead of a primitive type).
-
-
-
-
-
-
- mongo.native_long
- int
-
-
-
-
- The default behavior for this has been changed to &true; in 1.5.0, so make
- sure to set this variable to the value you want (probably &true;) so that
- the driver's behavior doesn't suddenly change when you upgrade.
-
-
-
- On 64-bit platforms, the mongo.native_long setting
- allows for 64-bit integers to be stored in MongoDB. If it is not set, only
- 32-bits of the integer will be saved. The MongoDB data type that is used
- in this case is the BSON LONG, instead of the BSON INT that is used if
- this setting is turned off.
-
-
- The setting also changes the way how BSON LONGs behave when they are read
- back from MongoDB. Without mongo.native_long enabled,
- the driver would convert every BSON LONG to a PHP double which can result
- in a loss of precision.
-
-
- On 32-bit platforms, the mongo.native_long setting
- changes nothing for storing integers in MongoDB: the integer is stored
- as a BSON INT as before. However, when the setting is enabled and a
- BSON LONG is read from MongoDB a
- MongoCursorException is thrown alerting you that
- the data could not be read back without losing precision.
-
-
- On 32-bit systems especially, it is recommended that you combine this with
- enabling mongo.long_as_object.
-
-
-
-
-
-
- mongo.ping_interval
- int
-
-
-
- Added in version 1.2.10.
-
-
- For replicaset connections: The minimum interval with which the driver
- will send "ping" requests to the MongoDB server. If the value is lower,
- there will be more pings, but the driver finds faster whether a node is
- no longer reachable from the replicaset.
-
-
-
-
-
-
- mongo.utf8
- int
-
-
-
- If an exception should be thrown for non-UTF8 strings. Until version
- 1.0.4, the PHP driver would ignore non-UTF8 strings, even though you're
- not supposed to insert them. As of 1.0.4, the driver throws a
- MongoException. To ease the transition for
- applications that insert non-UTF8 strings, you can turn this option off to
- emulate the old, non-exception-throwning behavior. This option will be
- eliminated and exceptions always thrown for non-UTF8 strings starting with
- version 1.1.0.
-
-
-
-
-
-
-
-
-
diff --git a/reference/mongo/manual.xml b/reference/mongo/manual.xml
deleted file mode 100644
index ef95459f01..0000000000
--- a/reference/mongo/manual.xml
+++ /dev/null
@@ -1,53 +0,0 @@
-
-
-
-
- Manual
-
-
- &mongo.deprecated.note;
-
-
- This manual goes into some detail about how to use MongoDB, but it mostly
- covers using the PHP driver. For information about how to design a
- schema, what terms means, and setting up the database server, check out the
- MongoDB documentation.
-
-
-
- &reference.mongo.tutorial;
- &reference.mongo.readpreferences;
- &reference.mongo.writeconcerns;
- &reference.mongo.sqltomongo;
- &reference.mongo.connecting;
- &reference.mongo.context;
- &reference.mongo.writes;
- &reference.mongo.queries;
- &reference.mongo.updates;
- &reference.mongo.security;
- &reference.mongo.trouble;
- &reference.mongo.testing;
-
-
-
-
-
diff --git a/reference/mongo/misc.xml b/reference/mongo/misc.xml
deleted file mode 100644
index af2976e99d..0000000000
--- a/reference/mongo/misc.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
-
- Miscellaneous
-
- &reference.mongo.mongolog;
- &reference.mongo.mongopool;
- &reference.mongo.mongo;
-
-
diff --git a/reference/mongo/mongo.xml b/reference/mongo/mongo.xml
deleted file mode 100644
index 897309a3a5..0000000000
--- a/reference/mongo/mongo.xml
+++ /dev/null
@@ -1,93 +0,0 @@
-
-
-
-
-
- The Mongo class [deprecated]
- Mongo
-
-
-
-
- &reftitle.intro;
-
- A connection between PHP and MongoDB.
-
-
- This class extends MongoClient and provides access to
- several deprecated methods.
-
-
- For backwards compatibility, it also defaults the "w"
- option of its constructor argument to 0, which does not
- require write operations to be acknowledged by the server. See
- MongoClient::__construct for more information.
-
-
-
-
- This class has been DEPRECATED as of version
- 1.3.0. Relying on this feature is highly discouraged. Please use
- MongoClient instead.
-
-
-
-
-
-
- &reftitle.classsynopsis;
-
-
-
- Mongo
-
-
-
-
- Mongo
-
-
-
- extends
- MongoClient
-
-
-
-
- &Methods;
-
-
- &InheritedMethods;
-
-
-
-
-
-
-
-
-
- &reference.mongo.entities.mongo;
-
-
-
-
diff --git a/reference/mongo/mongo/connectutil.xml b/reference/mongo/mongo/connectutil.xml
deleted file mode 100644
index 58e0dbb2dc..0000000000
--- a/reference/mongo/mongo/connectutil.xml
+++ /dev/null
@@ -1,63 +0,0 @@
-
-
-
-
-
- Mongo::connectUtil
- Connects with a database server
-
-
-
- &reftitle.description;
-
- protectedboolMongo::connectUtil
-
-
-
-
- This is an internal function that you should never
- call yourself.
-
-
-
-
-
- &reftitle.parameters;
- &no.function.parameters;
-
-
-
- &reftitle.returnvalues;
-
- If the connection was successful.
-
-
-
-
- &reftitle.errors;
-
- Throws MongoConnectionException if it fails to connect
- to the databases.
-
-
-
-
-
diff --git a/reference/mongo/mongo/construct.xml b/reference/mongo/mongo/construct.xml
deleted file mode 100644
index fa0941044c..0000000000
--- a/reference/mongo/mongo/construct.xml
+++ /dev/null
@@ -1,62 +0,0 @@
-
-
-
-
-
- Mongo::__construct
- The __construct purpose
-
-
-
- &reftitle.description;
-
- publicMongo::__construct
- stringserver
- arrayoptions
-
-
- This method overwrites the MongoClient constructor
- and turns off acknowledged writes.
-
-
- Please see MongoClient::__construct for
- description of the parameters.
-
-
-
-
- &reftitle.returnvalues;
-
-
- Instanciating this class will emit E_DEPRECATED
- warning, and turn off acknowledged writes.
-
-
-
- Please use the MongoClient instead.
-
-
-
-
-
-
-
diff --git a/reference/mongo/mongo/getpoolsize.xml b/reference/mongo/mongo/getpoolsize.xml
deleted file mode 100644
index 929086c4e3..0000000000
--- a/reference/mongo/mongo/getpoolsize.xml
+++ /dev/null
@@ -1,127 +0,0 @@
-
-
-
-
-
- Mongo::getPoolSize
- Get pool size for connection pools
-
-
-
- &reftitle.description;
-
- publicstaticintMongo::getPoolSize
-
-
-
-
- This feature has been DEPRECATED as of version
- 1.2.3. Relying on this feature is highly discouraged. Please use
- MongoPool::getSize instead.
-
-
-
-
-
-
- &reftitle.parameters;
- &no.function.parameters;
-
-
-
- &reftitle.returnvalues;
-
- Returns the current pool size.
-
-
-
-
- &reftitle.changelog;
-
-
-
-
-
- &Version;
- &Description;
-
-
-
-
- PECL mongo 1.2.11
- Emits E_DEPRECATED when used.
-
-
-
-
-
-
-
-
- &reftitle.examples;
-
- Changing pool size
-
- This returns the default pool size, sets a new pool size, then prints the
- new pool size and the pool debugging information. Note that changing the
- pool size only affects new connection pools, it does not change old ones.
-
-
-
-]]>
-
-
-
-
-
- &reftitle.seealso;
-
-
- Mongo::setPoolSize
- Mongo::poolDebug
- The connection documentation.
-
-
-
-
-
-
diff --git a/reference/mongo/mongo/getslave.xml b/reference/mongo/mongo/getslave.xml
deleted file mode 100644
index b16d0d3259..0000000000
--- a/reference/mongo/mongo/getslave.xml
+++ /dev/null
@@ -1,112 +0,0 @@
-
-
-
-
-
- Mongo::getSlave
- Returns the address being used by this for slaveOkay reads
-
-
-
- &reftitle.description;
-
- publicstringMongo::getSlave
-
-
-
-
- This finds the address of the secondary currently being used for reads. It is
- a read-only method: it does not change anything about the internal state of
- the object.
-
-
-
- When you create a connection to the database, the driver will not immediately
- decide on a secondary to use. Thus, after you connect, this function will
- return &null; even if there are secondaries available. When you first do a
- query with slaveOkay set, at that point the driver will choose a secondary
- for this connection. At that point, this function will return the chosen
- secondary.
-
-
-
- See the query section of this manual for
- information on distributing reads to secondaries.
-
-
-
-
-
- &reftitle.parameters;
- &no.function.parameters;
-
-
-
- &reftitle.returnvalues;
-
- The address of the secondary this connection is using for reads.
-
-
- This returns &null; if this is not connected to a replica set or not yet
- initialized.
-
-
-
-
- &reftitle.errors;
- &mongo.errors.deprecated;
-
- The returned results aren't really useful as the secondary selection
- process is done on each query and database command execution.
-
-
-
-
- &reftitle.changelog;
-
-
-
-
-
- &Version;
- &Description;
-
-
-
-
- PECL mongo 1.2.11
- Emits E_DEPRECATED when used.
-
-
-
-
-
-
-
-
- &reftitle.seealso;
-
- MongoCursor::info
-
-
-
-
-
diff --git a/reference/mongo/mongo/getslaveokay.xml b/reference/mongo/mongo/getslaveokay.xml
deleted file mode 100644
index 33c7f3d18f..0000000000
--- a/reference/mongo/mongo/getslaveokay.xml
+++ /dev/null
@@ -1,89 +0,0 @@
-
-
-
-
-
- Mongo::getSlaveOkay
- Get slaveOkay setting for this connection
-
-
-
- &reftitle.description;
-
- publicboolMongo::getSlaveOkay
-
-
-
-
- See the query section of this manual for
- information on distributing reads to secondaries.
-
-
-
-
- &reftitle.parameters;
- &no.function.parameters;
-
-
-
- &reftitle.returnvalues;
-
- Returns the value of slaveOkay for this instance.
-
-
-
-
- &reftitle.errors;
- &mongo.errors.deprecated;
-
-
-
- &reftitle.changelog;
-
-
-
-
-
- &Version;
- &Description;
-
-
-
-
- PECL mongo 1.2.11
- Emits E_DEPRECATED when used.
-
-
-
-
-
-
-
-
- &reftitle.seealso;
-
-
- MongoClient::getReadPreference
-
-
-
-
-
diff --git a/reference/mongo/mongo/pooldebug.xml b/reference/mongo/mongo/pooldebug.xml
deleted file mode 100644
index 360907cb84..0000000000
--- a/reference/mongo/mongo/pooldebug.xml
+++ /dev/null
@@ -1,141 +0,0 @@
-
-
-
-
-
- Mongo::poolDebug
- Returns information about all connection pools
-
-
-
- &reftitle.description;
-
- publicarrayMongo::poolDebug
-
-
-
-
- This feature has been DEPRECATED as of version
- 1.2.3. Relying on this feature is highly discouraged. Please use
- MongoPool::info instead.
-
-
-
-
- Returns an array of information about all connection pools.
-
-
-
-
- &reftitle.parameters;
- &no.function.parameters;
-
-
-
- &reftitle.returnvalues;
-
- Each connection pool has an identifier, which starts with the host. For each
- pool, this function shows the following fields:
-
-
-
- in use
-
-
-
- The number of connections currently being used by
- MongoClient instances.
-
-
-
-
-
- in pool
-
-
-
- The number of connections currently in the pool (not being used).
-
-
-
-
-
- remaining
-
-
-
- The number of connections that could be created by this pool. For
- example, suppose a pool had 5 connections remaining and 3 connections in
- the pool. We could create 8 new instances of
- MongoClient before we exhausted this pool
- (assuming no instances of MongoClient went out of
- scope, returning their connections to the pool).
-
-
- A negative number means that this pool will spawn unlimited connections.
-
-
- Before a pool is created, you can change the max number of connections by
- calling Mongo::setPoolSize. Once a pool is showing
- up in the output of this function, its size cannot be changed.
-
-
-
-
-
- timeout
-
-
-
- The socket timeout for connections in this pool. This is how long
- connections in this pool will attempt to connect to a server before
- giving up.
-
-
-
-
-
-
-
-
- &reftitle.changelog;
-
-
-
-
-
- &Version;
- &Description;
-
-
-
-
- PECL mongo 1.2.11
- Emits E_DEPRECATED when used.
-
-
-
-
-
-
-
-
-
diff --git a/reference/mongo/mongo/setpoolsize.xml b/reference/mongo/mongo/setpoolsize.xml
deleted file mode 100644
index 5cafb52e60..0000000000
--- a/reference/mongo/mongo/setpoolsize.xml
+++ /dev/null
@@ -1,129 +0,0 @@
-
-
-
-
-
- Mongo::setPoolSize
- Set the size for future connection pools
-
-
-
- &reftitle.description;
-
- publicstaticboolMongo::setPoolSize
- intsize
-
-
-
- This method has been DEPRECATED as of version
- 1.2.3. Relying on this feature is highly discouraged. Please use
- MongoPool::setSize instead.
-
-
-
-
- Sets the max number of connections new pools will be able to create.
-
-
-
-
- &reftitle.parameters;
-
-
-
-
- size
-
-
-
- The max number of connections future pools will be able to create.
- Negative numbers mean that the pool will spawn an infinite number of
- connections.
-
-
-
-
-
-
-
-
- &reftitle.returnvalues;
-
- Returns the former value of pool size.
-
-
-
-
-
- &reftitle.examples;
-
-
- Mongo::setPoolSize example
-
- If you set the pool size to n and then create
- n connections, attempting to create an
- n+1st connection will throw a
- MongoConnectionException.
-
-
-
-]]>
-
- &example.outputs.similar;
-
-__construct()
-#1 {main}
- thrown in /path/to/php/script.php on line 10
-]]>
-
-
-
-
-
-
-
- &reftitle.seealso;
-
-
- Mongo::getPoolSize
- Mongo::poolDebug
- The connection documentation.
-
-
-
-
-
diff --git a/reference/mongo/mongo/setslaveokay.xml b/reference/mongo/mongo/setslaveokay.xml
deleted file mode 100644
index 3e87d7797f..0000000000
--- a/reference/mongo/mongo/setslaveokay.xml
+++ /dev/null
@@ -1,98 +0,0 @@
-
-
-
-
-
- Mongo::setSlaveOkay
- Change slaveOkay setting for this connection
-
-
-
- &reftitle.description;
-
- publicboolMongo::setSlaveOkay
- boolok&true;
-
-
-
- See the query section of this manual for
- information on distributing reads to secondaries.
-
-
-
-
- &reftitle.parameters;
-
-
-
-
- ok
-
-
-
- If reads should be sent to secondary members of a replica set for all
- possible queries using this MongoClient instance.
-
-
-
-
-
-
-
-
- &reftitle.returnvalues;
-
- Returns the former value of slaveOkay for this instance.
-
-
-
-
- &reftitle.changelog;
-
-
-
-
-
- &Version;
- &Description;
-
-
-
-
- PECL mongo 1.2.11
- Emits E_DEPRECATED when used.
-
-
-
-
-
-
-
-
- &reftitle.seealso;
-
-
- MongoClient::setReadPreference
-
-
-
-
-
diff --git a/reference/mongo/mongo/switchslave.xml b/reference/mongo/mongo/switchslave.xml
deleted file mode 100644
index ff800d00d8..0000000000
--- a/reference/mongo/mongo/switchslave.xml
+++ /dev/null
@@ -1,112 +0,0 @@
-
-
-
-
-
- Mongo::switchSlave
- Choose a new secondary for slaveOkay reads
-
-
-
- &reftitle.description;
-
- publicstringMongo::switchSlave
-
-
-
-
- This choses a random secondary for a connection to read from. It is called
- automatically by the driver and should not need to be used. It calls
- MongoClient::getHosts (to refresh the status of hosts)
- and Mongo::getSlave (to get the return value).
-
-
-
- See the query section of this manual for
- information on distributing reads to secondaries.
-
-
-
-
-
- &reftitle.parameters;
- &no.function.parameters;
-
-
-
- &reftitle.returnvalues;
-
- The address of the secondary this connection is using for reads. This may be
- the same as the previous address as addresses are randomly chosen. It may
- return only one address if only one secondary (or only the primary) is
- available.
-
-
- For example, if we had a three member replica set with a primary, secondary,
- and arbiter this method would always return the address of the secondary.
- If the secondary became unavailable, this method would always return the
- address of the primary. If the primary also became unavailable, this method
- would throw an exception, as an arbiter cannot handle reads.
-
-
-
-
- &reftitle.errors;
-
- Throws a MongoException (error code 15) if it is
- called on a non-replica-set connection. It will also throw
- MongoExceptions if it cannot find anyone (primary or
- secondary) to read from (error code 16).
-
-
-
-
- &reftitle.changelog;
-
-
-
-
-
- &Version;
- &Description;
-
-
-
-
- PECL mongo 1.2.11
- Emits E_DEPRECATED when used.
-
-
-
-
-
-
-
-
- &reftitle.seealso;
-
-
-
-
-
-
-
-
diff --git a/reference/mongo/mongobindata.xml b/reference/mongo/mongobindata.xml
deleted file mode 100644
index 450f1991a8..0000000000
--- a/reference/mongo/mongobindata.xml
+++ /dev/null
@@ -1,260 +0,0 @@
-
-
-
-
-
- The MongoBinData class
- MongoBinData
-
-
-
-
- &mongo.alternative.class.note;
-
- MongoDB\BSON\Binary
-
-
-
-
-
- &reftitle.intro;
-
- An object that can be used to store or retrieve binary data from the database.
-
-
- The maximum size of a single object that can be inserted into the database
- is 16MB. For data that is larger than this (movies, music, Henry Kissinger's
- autobiography), use MongoGridFS. For data that is
- smaller than 16MB, you may find it easier to embed it within the document
- using MongoBinData.
-
-
- For example, to embed an image in a document, one could write:
-
-
-
- "foobity",
- "pic" => new MongoBinData(file_get_contents("gravatar.jpg"), MongoBinData::GENERIC),
-);
-
-$users->save($profile);
-
-?>
-]]>
-
-
-
- This class contains a type field, which currently gives
- no additional functionality in the PHP driver or the database. There are
- seven predefined types, which are defined as class constants below. For
- backwards compatibility, the PHP driver uses
- MongoBinData::BYTE_ARRAY as the default; however, this
- may change to MongoBinData::GENERIC in the future.
- Users are encouraged to specify a type in
- MongoBinData::__construct.
-
-
-
-
-
- &reftitle.classsynopsis;
-
-
-
- MongoBinData
-
-
-
-
- MongoBinData
-
-
-
-
- &Constants;
-
- const
- int
- MongoBinData::GENERIC
- 0
-
-
- const
- int
- MongoBinData::FUNC
- 1
-
-
- const
- int
- MongoBinData::BYTE_ARRAY
- 2
-
-
- const
- int
- MongoBinData::UUID
- 3
-
-
- const
- int
- MongoBinData::UUID_RFC4122
- 4
-
-
- const
- int
- MongoBinData::MD5
- 5
-
-
- const
- int
- MongoBinData::CUSTOM
- 128
-
-
- Fields
-
- public
- string
- bin
-
-
- public
- int
- type
- 2
-
-
- &Methods;
-
-
-
-
-
-
-
-
- &reftitle.constants;
-
- Binary Data Types
-
-
- MongoBinData::GENERIC
-
-
- Generic binary data.
-
-
-
-
- MongoBinData::FUNC
-
-
- Function.
-
-
-
-
- MongoBinData::BYTE_ARRAY
-
-
- Generic binary data (deprecated in favor of
- MongoBinData::GENERIC).
-
-
-
-
- MongoBinData::UUID
-
-
- Universally unique identifier (deprecated in favor of
- MongoBinData::UUID_RFC4122).
-
-
-
-
- MongoBinData::UUID_RFC4122
-
-
- Universally unique identifier (according to
- RFC 4122).
-
-
-
-
- MongoBinData::MD5
-
-
- MD5.
-
-
-
-
- MongoBinData::CUSTOM
-
-
- User-defined type.
-
-
-
-
-
-
-
-
-
- &reftitle.changelog;
-
-
-
-
- &Version;
- &Description;
-
-
-
-
- 1.5.0
-
- Added MongoBinData::GENERIC and
- MongoBinData::UUID_RFC4122 constants.
-
-
-
-
-
-
-
-
-
- &reference.mongo.entities.mongobindata;
-
-
-
-
diff --git a/reference/mongo/mongobindata/construct.xml b/reference/mongo/mongobindata/construct.xml
deleted file mode 100644
index 8425e6f4f0..0000000000
--- a/reference/mongo/mongobindata/construct.xml
+++ /dev/null
@@ -1,130 +0,0 @@
-
-
-
-
-
- MongoBinData::__construct
- Creates a new binary data object
-
-
-
-
- &mongo.alternative.method.note;
-
- MongoDB\BSON\Binary::__construct
-
-
-
-
-
- &reftitle.description;
-
- publicMongoBinData::__construct
- stringdata
- inttype0
-
-
- Creates a new binary data object.
-
-
- There are seven types of binary data currently recognized by the BSON spec,
- which are defined as
- class constants. For
- backwards compatibility, the PHP driver uses
- MongoBinData::BYTE_ARRAY as the default; however, this
- may change to MongoBinData::GENERIC in the future.
- Users are encouraged to specify a type instead of relying on the default.
-
-
-
-
- &reftitle.parameters;
-
-
-
-
- data
-
-
-
- Binary data.
-
-
-
-
-
- type
-
-
-
- Data type.
-
-
-
-
-
-
-
-
- &reftitle.returnvalues;
-
- Returns a new binary data object.
-
-
-
-
- &reftitle.changelog;
-
-
-
-
-
- &Version;
- &Description;
-
-
-
-
- PECL mongo 1.5.0
-
- The default changed from 2
- (MongoBinData::BYTE_ARRAY) to
- 0 (MongoBinData::GENERIC).
-
-
-
- PECL mongo 1.2.11
-
- Emits E_DEPRECATED when the second argument is not
- used. The default value for type may change in
- the near future.
-
-
-
-
-
-
-
-
-
-
-
diff --git a/reference/mongo/mongobindata/tostring.xml b/reference/mongo/mongobindata/tostring.xml
deleted file mode 100644
index 112baac118..0000000000
--- a/reference/mongo/mongobindata/tostring.xml
+++ /dev/null
@@ -1,60 +0,0 @@
-
-
-
-
-
- MongoBinData::__toString
- The string representation of this binary data object
-
-
-
-
- &mongo.alternative.method.note;
-
- MongoDB\BSON\Binary::getData
-
-
-
-
-
- &reftitle.description;
-
- publicstringMongoBinData::__toString
-
-
-
-
-
- &reftitle.parameters;
- &no.function.parameters;
-
-
-
- &reftitle.returnvalues;
-
- Returns the string "<Mongo Binary Data>". To access the contents of a
- MongoBinData, use the bin field.
-
-
-
-
-
diff --git a/reference/mongo/mongoclient.xml b/reference/mongo/mongoclient.xml
deleted file mode 100644
index 9e7565f646..0000000000
--- a/reference/mongo/mongoclient.xml
+++ /dev/null
@@ -1,297 +0,0 @@
-
-
-
-
-
- The MongoClient class
- MongoClient
-
-
-
-
-
- &mongo.alternative.class.note;
-
- MongoDB\Driver\Manager
-
-
-
-
- &reftitle.intro;
-
- A connection manager for PHP and MongoDB.
-
-
- This class is used to create and manage connections. A typical use is:
-
- MongoClient basic usage
-
-foo; // get the database named "foo"
-
-?>
-]]>
-
-
-
-
- See MongoClient::__construct and the section on
- connecting for more information
- about creating connections.
-
-
-
-
-
- &reftitle.classsynopsis;
-
-
-
- MongoClient
-
-
-
-
- MongoClient
-
-
-
-
- &Constants;
-
- const
- string
- MongoClient::VERSION
-
-
- const
- string
- MongoClient::DEFAULT_HOST
- "localhost"
-
-
- const
- int
- MongoClient::DEFAULT_PORT
- 27017
-
-
- const
- string
- MongoClient::RP_PRIMARY
- "primary"
-
-
- const
- string
- MongoClient::RP_PRIMARY_PREFERRED
- "primaryPreferred"
-
-
- const
- string
- MongoClient::RP_SECONDARY
- "secondary"
-
-
- const
- string
- MongoClient::RP_SECONDARY_PREFERRED
- "secondaryPreferred"
-
-
- const
- string
- MongoClient::RP_NEAREST
- "nearest"
-
-
- &Properties;
-
- public
- bool
- connected
- &false;
-
-
- public
- string
- status
- &null;
-
-
- protected
- string
- server
- &null;
-
-
- protected
- bool
- persistent
- &null;
-
-
- &Methods;
-
-
-
-
-
-
-
-
-
- &reftitle.constants;
-
- MongoClient Constants
-
-
- MongoClient::VERSION
-
-
- PHP driver version. May be suffixed with "dev", "+" or "-" if it is
- in-between versions.
-
-
-
-
- MongoClient::DEFAULT_HOST
-
-
- Host to connect to if no host is given.
-
-
-
-
- MongoClient::DEFAULT_PORT
-
-
- Port to connect to if no port is given.
-
-
-
-
- MongoClient::RP_PRIMARY
-
-
- Read preference for the
- primary replica set member.
-
-
-
-
- MongoClient::RP_PRIMARY_PREFERRED
-
-
- Read preference for
- preferring the primary replica set member.
-
-
-
-
- MongoClient::RP_SECONDARY
-
-
- Read preference for a
- secondary replica set member.
-
-
-
-
- MongoClient::RP_SECONDARY_PREFERRED
-
-
- Read preference for
- preferring a secondary replica set member.
-
-
-
-
- MongoClient::RP_NEAREST
-
-
- Read preference for the
- nearest replica set member.
-
-
-
-
-
-
-
-
- Fields
-
-
- connected
-
-
- This property will be set to &true; if we have a open connection to
- the database, &false; otherwise. If the connection is to a replica set,
- this property will only be &true; if the driver has a connection to a
- node matching the current read preference. This property does not take
- authentication into account.
-
-
- This property is deprecated since version 1.5.0.
-
-
-
-
- status
-
-
- This property is no longer used and will be set to &null; In driver
- versions 1.1.x and earlier, this may be set to a string value (e.g.
- "recycled", "new") when persistent
- connections are used.
-
-
- This property is deprecated since version 1.5.0.
-
-
-
-
-
-
-
- &reftitle.seealso;
-
-
-
-
- MongoDB core docs on connecting
-
-
-
-
-
-
- &reference.mongo.entities.mongoclient;
-
-
-
-
diff --git a/reference/mongo/mongoclient/close.xml b/reference/mongo/mongoclient/close.xml
deleted file mode 100644
index f9bdf4a95b..0000000000
--- a/reference/mongo/mongoclient/close.xml
+++ /dev/null
@@ -1,175 +0,0 @@
-
-
-
-
-
- MongoClient::close
- Closes this connection
-
-
-
-
- &mongo.noalternative.method.note;
-
-
-
-
- &reftitle.description;
-
- publicboolMongoClient::close
- boolstringconnection
-
-
- The MongoClient::close method forcefully closes a
- connection to the database, even if persistent connections are being used.
- You should never have to do this under normal
- circumstances.
-
-
-
-
-
-
- &reftitle.parameters;
-
-
-
-
- connection
-
-
-
- If connection is not given, or &false; then connection that would be
- selected for writes would be closed. In a single-node configuration,
- that is then the whole connection, but if you are connected to a
- replica set, close() will only close the
- connection to the primary server.
-
-
- If connection is &true; then all connections as known by the connection
- manager will be closed. This can include connections that are not
- referenced in the connection string used to create the object that
- you are calling close on.
-
-
- If connection is a string argument, then it will only close the
- connection identified by this hash. Hashes are identifiers for a
- connection and can be obtained by calling
- MongoClient::getConnections.
-
-
-
-
-
-
-
-
- &reftitle.returnvalues;
-
- Returns if the connection was successfully closed.
-
-
-
-
- &reftitle.examples;
-
- MongoClient::close example
- This example demonstrates how to selectively close all connections
- for secondaries only.
-
-getConnections();
-
-foreach ( $connections as $con )
-{
- // Loop over all the connections, and when the type is "SECONDARY"
- // we close the connection
- if ( $con['connection']['connection_type_desc'] == "SECONDARY" )
- {
- echo "Closing '{$con['hash']}': ";
- $closed = $a->close( $con['hash'] );
- echo $closed ? "ok" : "failed", "\n";
- }
-}
-?>
-]]>
-
- &example.outputs;
-
-
-
-
-
-
-
- &reftitle.changelog;
-
-
-
-
-
- &Version;
- &Description;
-
-
-
-
- PECL mongo 1.3.0
-
-
- The connection parameter to this function was
- added in 1.3.0. Before that, only the write connection would be
- closed by this method.
-
-
-
-
- PECL mongo 1.2.0
-
-
- Before version 1.2.0 the driver would not use persistent connections
- by default, and all connections would be closed as soon as a MongoDB
- connection went out if scope. Since version 1.2.0 this is no longer
- the case and it is a bad idea to call close as you might end up
- overloading the server with connections under high load.
-
-
-
-
-
-
-
-
-
-
- &reftitle.seealso;
-
- MongoClient::getConnections
-
-
-
-
diff --git a/reference/mongo/mongoclient/connect.xml b/reference/mongo/mongoclient/connect.xml
deleted file mode 100644
index 32e9aff4c4..0000000000
--- a/reference/mongo/mongoclient/connect.xml
+++ /dev/null
@@ -1,63 +0,0 @@
-
-
-
-
-
- MongoClient::connect
- Connects to a database server
-
-
-
-
- &mongo.noalternative.method.note;
-
-
-
-
- &reftitle.description;
-
- publicboolMongoClient::connect
-
-
-
-
-
- &reftitle.parameters;
- &no.function.parameters;
-
-
-
- &reftitle.returnvalues;
-
- If the connection was successful.
-
-
-
-
- &reftitle.errors;
-
- Throws MongoConnectionException if it fails to connect
- to the database.
-
-
-
-
-
diff --git a/reference/mongo/mongoclient/construct.xml b/reference/mongo/mongoclient/construct.xml
deleted file mode 100644
index ef2e75ac84..0000000000
--- a/reference/mongo/mongoclient/construct.xml
+++ /dev/null
@@ -1,855 +0,0 @@
-
-
-
-
-
- MongoClient::__construct
- Creates a new database connection object
-
-
-
-
- &mongo.alternative.method.note;
-
- MongoDB\Driver\Manager::__construct
-
-
-
-
-
- &reftitle.description;
-
- publicMongoClient::__construct
- stringserver"mongodb://localhost:27017"
- arrayoptionsarray("connect" => &true;)
- arraydriver_options
-
-
- If no parameters are passed, this connects to "localhost:27017" (or whatever
- was specified in php.ini for
- mongo.default_host and
- mongo.default_port).
-
-
- server should have the form:
-
-
-
-
-
- The connection string always starts with mongodb://, to
- indicate it is a connection string in this form.
-
- If username and password
- are specified, the constructor will attempt to authenticate the connection
- with the database before returning. Username and password are optional
- and must be followed by an @, if specified.
-
-
- At least one host must be given (port optional, always defaulting to 27017)
- and as many hosts as desired may be connected to. Host names are
- comma-separated and the constructor will return successfully if it connected
- to at least one host. If it could not connect to any of the hosts, it will
- throw a MongoConnectionException. Please see the
- Replica Sets section for
- information on how to connect to Replica Sets.
-
-
- If you specified a username and password, you may specify a database to
- authenticate with. If db is not specified, "admin" will
- be used.
-
-
- An optional query string may be used to specify extra options. The same
- options are supported through the options array as
- well, and are therefore redescribed there. See the examples below on
- how to set those options.
-
-
- One part of the options governs how the driver reads from secondary nodes
- in a replica set environment. Extra information on how these read
- preferences work is available as well through the read preferences documentation page.
-
-
-
-
- &reftitle.parameters;
-
-
-
-
- server
-
-
-
- The server name.
-
-
-
-
-
- options
-
-
-
- An array of options for the connection. Currently available options
- include:
-
-
-
- "authMechanism"
-
-
- Available mechanisms are:
-
-
-
-
- authMechanism
- Description
- Availability
-
-
-
-
- MONGODB-CR
- Authenticate using Challenge Response mechanism. This is the default value.
- All MongoDB versions
-
-
- MONGODB-X509
- Authenticates using X509 certificates
- MongoDB 2.6. Only available when is enabled
-
-
- PLAIN
- Authenticates using unencrypted plain username+password. Must be used over SSL connections. Generally used by MongoDB to login via 3rd party LDAP server
- MongoDB Enterprise 2.4. The Driver must be compiled against CyrusSASL2
-
-
- GSSAPI
- Authenticates via kerberos systems
- MongoDB Enterprise 2.4. The Driver must be compiled against CyrusSASL2
-
-
- SCRAM-SHA-1
- Authenticates using SCRAM-SHA-1
- MongoDB 3.0.
-
-
-
-
-
-
-
-
- "authSource"
-
-
- Should be set to the database name where the user is defined it.
-
-
-
-
- "connect"
-
-
- If the constructor should connect before returning. Default is
- &true;. When set to &false; the driver will
- automatically connect to the server whenever
- it is necessary to do a query. Alternatively, you can run
- MongoClient::connect manually.
-
-
-
- This option is not supported through the connection string.
-
-
-
-
-
- "connectTimeoutMS"
-
-
- How long a connection can take to be opened before timing out in
- milliseconds. Defaults to 60000 (60 seconds).
-
-
- If -1 is specified, no connection timeout will be
- applied and PHP will use
- default_socket_timeout.
-
-
-
-
- "db"
-
-
- The database to authenticate against can be specified here, instead of
- including it in the host list. This overrides a database given in the
- host list.
-
-
-
-
- "fsync"
-
-
- When "fsync" is set, all write operations will
- block until the database has flushed the changes to disk. This makes
- the write operations slower, but it guarantees that writes have
- succeeded and that the operations can be recovered in case of total
- system failure.
-
-
- If the MongoDB server has journaling enabled, this option is identical
- to "journal". If journaling is not enabled, this
- option ensures that write operations will be synced to database files
- on disk.
-
-
-
- If journaling is enabled, users are strongly encouraged to use the
- "journal" option instead of
- "fsync". Do not use "fsync" and
- "journal" simultaneously, as that will result in
- an error.
-
-
-
-
-
- "journal"
-
-
- When "journal" is set, all write operations will
- block until the database has flushed the changes to the journal on
- disk. This makes the write operations slower, but it guarantees that
- writes have succeeded and that the operations can be recovered in case
- of total system failure.
-
-
-
- If this option is used and journaling is disabled, MongoDB 2.6+ will
- raise an error and the write will fail; older server versions will
- simply ignore the option.
-
-
-
-
-
- "gssapiServiceName"
-
-
- Sets the Kerberos service principal. Only applicable when authMechanism=GSSAPI. Defaults to "mongodb".
-
-
-
-
- "password"
-
-
- The password can be specified here, instead of including it in the
- host list. This is especially useful if a password has a "@" in it.
- This overrides a password set in the host list.
-
-
-
-
- "readPreference"
-
-
- Specifies the read preference type. Read preferences provide you
- with control from which secondaries data can be read from.
-
-
- Allowed values are: MongoClient::RP_PRIMARY,
- MongoClient::RP_PRIMARY_PREFERRED,
- MongoClient::RP_SECONDARY,
- MongoClient::RP_SECONDARY_PREFERRED and
- MongoClient::RP_NEAREST.
-
-
- See the documentation on read
- preferences for more information.
-
-
-
-
- "readPreferenceTags"
-
-
- Specifies the read preference tags as an array of strings. Tags can be
- used in combination with the readPreference option
- to further control which secondaries data might be read from.
-
-
- See the documentation on read
- preferences for more information.
-
-
-
-
- "replicaSet"
-
-
- The name of the replica set to connect to. If this is given, the
- primary will be automatically be determined. This means that the
- driver may end up connecting to a server that was not even listed.
- See the replica set example below for details.
-
-
-
-
- "secondaryAcceptableLatencyMS"
-
-
- When reading from a secondary (using ReadPreferences), do not read from secondaries known to be more then
- secondaryAcceptableLatencyMS away from us. Defaults to 15
-
-
-
-
- "socketTimeoutMS"
-
-
- How long a socket operation (read or write) can take before timing out
- in milliseconds. Defaults to 30000 (30 seconds).
-
-
- If -1 is specified, socket operations may block
- indefinitely. This option may also be set on a per-operation basis
- using MongoCursor::timeout for queries or the
- "socketTimeoutMS" option for write methods.
-
-
-
- This is a client-side timeout. If a write operation times out, there
- is no way to know if the server actually handled the write or not, as
- a MongoCursorTimeoutException will be thrown
- in lieu of returning a write result.
-
-
-
-
-
- "ssl"
-
-
- A boolean to specify whether you want to enable SSL for the
- connections to MongoDB. Extra options such as certificates
- can be set with .
-
-
-
-
- "username"
-
-
- The username can be specified here, instead of including it in the
- host list. This is especially useful if a username has a ":" in it.
- This overrides a username set in the host list.
-
-
-
-
- "w"
-
-
- The w option specifies the
- Write Concern for the driver,
- which determines how long the driver blocks when writing. The
- default value is 1.
-
-
- This option is applicable when connecting to both single servers and
- replica sets. A positive value controls how many
- nodes must acknowledge the write instruction before the driver
- continues. A value of 1 would require the single
- server or primary (in a replica set) to acknowledge the write
- operation. A value of 3 would cause the driver to
- block until the write has been applied to the primary as well as two
- secondary servers (in a replica set).
-
-
- A string value is used to control which tag sets are taken into
- account for write concerns. "majority" is special
- and ensures that the write operation has been applied to the majority
- (more than 50%) of the participating nodes.
-
-
-
-
- "wTimeoutMS"
-
-
- This option specifies the time limit, in milliseconds, for
- write concern
- acknowledgement. It is only applicable for write operations where
- "w" is greater than 1, as the
- timeout pertains to replication. If the write concern is not satisfied
- within the time limit, a MongoCursorException
- will be thrown. A value of 0 may be specified to
- block indefinitely. The default value is 10000
- (ten seconds).
-
-
-
-
-
- The following options are deprecated and should no longer be used:
-
-
-
- "slaveOkay"
-
-
- Deprecated. Please use the read
- preference options.
-
-
-
-
- "timeout"
-
-
- Deprecated alias for "connectTimeoutMS".
-
-
-
-
- "wTimeout"
-
-
- Deprecated alias for "wTimeoutMS".
-
-
-
-
-
-
-
-
-
- driver_options
-
-
-
- An array of options for the MongoDB driver. Options include setting
- connection context options for SSL
- or logging callbacks.
-
-
-
- "context"
-
-
- The Stream Context to attach to all new connections. This allows you
- for example to configure SSL certificates and are described at
- SSL context options. See the
- Connecting over SSL tutorial.
-
-
-
-
-
-
-
-
-
-
-
- &reftitle.returnvalues;
-
- Returns a new database connection object.
-
-
-
-
- &reftitle.errors;
-
- Throws MongoConnectionException if it tries and fails
- to connect to the database for all hostnames given. It will also throw a
- MongoConnnectionException if an invalid username or
- password is given. See MongoConnectionException
- documentation for common exceptions and their causes.
-
-
-
-
- &reftitle.examples;
-
- MongoClient::__construct replica set example
-
- This example shows how to connect the driver to a replica set. It assumes
- that there is a set of three servers: sf1.example.com, sf2.example.com, and
- ny1.example.com. The primary could be any one of these servers.
-
-
- "myReplSet"));
-
-?>
-]]>
-
-
- If the current primary fails, the driver will figure out which secondary
- server became the new primary and automatically start using that connection.
- Automatic failover will not work correctly if replicaSet
- is not specified.
-
-
- At least one seed in the seed list must be up for the driver to connect to
- the replica set.
-
-
- If you include seeds from two separate replica sets, behavior is undefined.
-
- See the
- core documentation on
- replica sets for more information.
-
-
-
- Connecting to a domain socket
-
- In version 1.0.9+, you can use a UNIX domain socket to connect to an
- instance of MongoDB running locally. This should be slightly faster than
- using a network connection.
-
-
- In version 1.5.0, the MongoDB server automatically opens a socket at
- /tmp/mongodb-<port>.sock. You can connect to this by specifying the
- path in your connection string:
-
-
-
-]]>
-
-
- You can combine this with any other connections you'd like:
-
-
-
-]]>
-
-
-
- MongoClient::__construct authentication example
-
- A user must exist in the admin database before attempting to use
- authentication. You can create one with the Mongo shell by running:
-
-
- use admin
-switched to db admin
-> db.addUser("testUser", "testPass");
-{
- "_id" : ObjectId("4b21272fd9ab21611d19095c"),
- "user" : "testUser",
- "pwd" : "03b9b27e0abf1865e2f6fcbd9845dd59"
-}
->
-]]>
-
-
- After creating a user with, in this case, username "testUser" and password
- "testPass", you can create an authenticated connection:
-
-
-
-]]>
-
-
-
- MongoClient::__construct read preference example
-
- 'rs'));
-?>
-]]>
-
-
- See the read preferences
- section of this manual for further information.
-
-
-
-
- MongoClient::__construct options example
-
- Options can be passed both through the query string in the connection
- string, or as an array passed as second argument to the constructor.
-
-
- Here we set the journal option to true and readPreference to secondary
- preferred as default for all write operations:
-
-
-
-]]>
-
-
- And now we do the same, but as an options array:
-
-
- true,
- 'readPreference' => 'secondary',
-);
-$m = new MongoClient("mongodb://localhost/", $options);
-?>
-]]>
-
-
-
-
- MongoClient::__construct read preference example
-
- 'rs'));
-?>
-]]>
-
-
- See the read preferences
- section of this manual for further information.
-
-
-
-
-
- &reftitle.changelog;
-
-
-
-
-
- &Version;
- &Description;
-
-
-
-
- PECL mongo 1.6.0
-
-
- Added support for "SCRAM-SHA-1" in
- "authMechanism" option.
-
-
-
-
- PECL mongo 1.5.0
-
-
- Added "authMechanism", "gssapiServiceName", and "secondaryAcceptableLatencyMS".
-
-
-
-
- PECL mongo 1.4.0
-
-
- Added "ssl" option and support for
- connecting over SSL.
-
-
- Added "wTimeoutMS" option, which replaces
- "wTimeout".
-
-
- Emits E_DEPRECATED when
- "slaveOkay" or "timeout" is used.
-
-
-
-
- PECL mongo 1.5.0
-
-
- Added "authSource".
-
-
-
-
- PECL mongo 1.3.4
-
-
- Added "connectTimeoutMS" and
- "socketTimeoutMS" options.
-
-
-
-
- PECL mongo 1.3.0
-
-
- Added "readPreference",
- "readPreferenceTags", "w", and
- "wTimeout" options.
-
-
-
-
- PECL mongo 1.2.0
-
-
- Added "username" and "password"
- options.
-
-
- Removed "persist" option, as all connections are
- now persistent. It can still be used, but it doesn't affect anything.
-
-
-
-
- "persist"
-
-
-
- If the connection should be persistent. If set, the connection will
- be persistent. The string representation of the value is used as an
- ID for the connection, so two instances of
- MongoClient that are initialized with
- array("persist" => "foobar") will share the same
- database connection, whereas an instance initialized with
- array("persist" => "barbaz") will use a different
- database connection.
-
-
-
-
-
- The "replicaSet" option now takes a string, not a
- boolean.
-
-
-
-
- PECL mongo 1.0.9
- Added "replicaSet" option.
-
-
- PECL mongo 1.0.2
-
-
- Changed constructor to take an array of options. Pre-1.0.2, the
- constructor took the following parameters:
-
-
-
-
- server
-
-
-
- The server name.
-
-
-
-
-
- connect
-
-
-
- Optional boolean parameter specifying if the constructor should
- connect to the database before returning. Defaults to &true;.
-
-
-
-
-
- persistent
-
-
-
- If the connection should be persistent.
-
-
-
-
-
- paired
-
-
-
- If the connection should be paired.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/reference/mongo/mongoclient/dropdb.xml b/reference/mongo/mongoclient/dropdb.xml
deleted file mode 100644
index a97672b828..0000000000
--- a/reference/mongo/mongoclient/dropdb.xml
+++ /dev/null
@@ -1,76 +0,0 @@
-
-
-
-
-
- MongoClient::dropDB
- Drops a database [deprecated]
-
-
-
- &mongo.alternative.phplib.note;
-
- MongoDB\Client::dropDatabase()
-
-
-
-
- &reftitle.description;
-
- publicarrayMongoClient::dropDB
- mixeddb
-
-
-
- Deprecated
-
- Use MongoDB::drop instead.
-
-
-
-
-
-
- &reftitle.parameters;
-
-
-
-
- db
-
-
-
- The database to drop. Can be a MongoDB object or the name of the database.
-
-
-
-
-
-
-
-
- &reftitle.returnvalues;
-
- Returns the database response.
-
-
-
-
diff --git a/reference/mongo/mongoclient/get.xml b/reference/mongo/mongoclient/get.xml
deleted file mode 100644
index 36b700fda9..0000000000
--- a/reference/mongo/mongoclient/get.xml
+++ /dev/null
@@ -1,94 +0,0 @@
-
-
-
-
-
- MongoClient::__get
- Gets a database
-
-
-
- &mongo.alternative.phplib.note;
-
- MongoDB\Client::__get()
-
-
-
-
- &reftitle.description;
-
- publicMongoDBMongoClient::__get
- stringdbname
-
-
- This is the cleanest way of getting a database. If the database name has any
- special characters, MongoClient::selectDB will need to
- be used; however, this should be sufficient for most cases.
-
-selectDB("foo");
-$db = $mongo->foo;
-
-?>
-]]>
-
-
-
-
-
- &reftitle.parameters;
-
-
-
-
- dbname
-
-
-
- The database name.
-
-
-
-
-
-
-
-
- &reftitle.returnvalues;
-
- Returns a new db object.
-
-
-
-
- &reftitle.errors;
-
- Throws a generic exception if the database name is invalid.
-
-
-
-
-
diff --git a/reference/mongo/mongoclient/getconnections.xml b/reference/mongo/mongoclient/getconnections.xml
deleted file mode 100644
index 098481770f..0000000000
--- a/reference/mongo/mongoclient/getconnections.xml
+++ /dev/null
@@ -1,117 +0,0 @@
-
-
-
-
-
- MongoClient::getConnections
- Return info about all open connections
-
-
-
- &mongo.noalternative.method.note;
-
-
-
- &reftitle.description;
-
- publicstaticarrayMongoClient::getConnections
-
-
-
- Returns an array of all open connections, and information about each of the
- servers
-
-
-
-
-
- &reftitle.parameters;
- &no.function.parameters;
-
-
-
- &reftitle.returnvalues;
-
- An array of open connections.
-
-
-
-
- &reftitle.examples;
-
- MongoClient::getConnections example
-
-getConnections());
-?>
-]]>
-
- &example.outputs.similar;
-
-
- array(3) {
- ["hash"]=>
- string(26) "localhost:27017;-;X;56052"
- ["server"]=>
- array(3) {
- ["host"]=>
- string(10) "localhost"
- ["port"]=>
- int(27017)
- ["pid"]=>
- int(56052)
- }
- ["connection"]=>
- array(8) {
- ["last_ping"]=>
- int(1354076401)
- ["last_ismaster"]=>
- int(0)
- ["ping_ms"]=>
- int(0)
- ["connection_type"]=>
- int(1)
- ["connection_type_desc"]=>
- string(10) "STANDALONE"
- ["max_bson_size"]=>
- int(16777216)
- ["tag_count"]=>
- int(0)
- ["tags"]=>
- array(0) {
- }
- }
- }
-}
-]]>
-
-
-
-
-
-
-
-
diff --git a/reference/mongo/mongoclient/gethosts.xml b/reference/mongo/mongoclient/gethosts.xml
deleted file mode 100644
index 0513324722..0000000000
--- a/reference/mongo/mongoclient/gethosts.xml
+++ /dev/null
@@ -1,159 +0,0 @@
-
-
-
-
-
- MongoClient::getHosts
- Updates status for all associated hosts
-
-
-
- &mongo.alternative.method.note;
-
- MongoDB\Driver\Manager::getServers
-
-
-
-
- &reftitle.description;
-
- publicarrayMongoClient::getHosts
-
-
-
-
- This method is only useful with a connection to a replica set. It returns
- the status of all of the hosts in the set. Without a replica set, it will
- just return an array with one element containing the host that you are
- connected to.
-
-
-
- See the query section of this manual for
- information on distributing reads to secondaries.
-
-
-
-
- &reftitle.parameters;
- &no.function.parameters;
-
-
-
- &reftitle.returnvalues;
-
- Returns an array of information about the hosts in the set. Includes each
- host's hostname, its health (1 is healthy), its state (1 is primary, 2 is
- secondary, 0 is anything else), the amount of time it took to ping the
- server, and when the last ping occurred. For example, on a three-member
- replica set, it might look something like:
-
-
-
- array(4) {
- ["host"]=>
- "A"
- ["port"]=>
- 27017
- ["health"]=>
- int(1)
- ["state"]=>
- int(2)
- ["ping"]=>
- int(369)
- ["lastPing"]=>
- int(1309470644)
- }
- ["B:27017"]=>
- array(4) {
- ["host"]=>
- "B"
- ["port"]=>
- 27017
- ["health"]=>
- int(1)
- ["state"]=>
- int(1)
- ["ping"]=>
- int(139)
- ["lastPing"]=>
- int(1309470644)
- }
- ["C:27017"]=>
- array(4) {
- ["host"]=>
- "C"
- ["port"]=>
- 27017
- ["health"]=>
- int(1)
- ["state"]=>
- int(2)
- ["ping"]=>
- int(1012)
- ["lastPing"]=>
- int(1309470644)
- }
-}
-]]>
-
-
-
-
- &reftitle.changelog;
-
-
-
-
-
- &Version;
- &Description;
-
-
-
-
- PECL mongo 1.2.10
-
-
- Support for non-replicasets was added.
-
-
- The returned array elements now also include the
- hostname and port.
-
-
-
-
-
-
-
-
-
-
- &reftitle.seealso;
-
- MongoClient::getConnections
-
-
-
-
diff --git a/reference/mongo/mongoclient/getreadpreference.xml b/reference/mongo/mongoclient/getreadpreference.xml
deleted file mode 100644
index 96473e75bc..0000000000
--- a/reference/mongo/mongoclient/getreadpreference.xml
+++ /dev/null
@@ -1,138 +0,0 @@
-
-
-
-
-
- MongoClient::getReadPreference
- Get the read preference for this connection
-
-
-
- &mongo.noalternative.method.note;
-
-
-
- &reftitle.description;
-
- publicarrayMongoClient::getReadPreference
-
-
-
-
-
- &reftitle.parameters;
- &no.function.parameters;
-
-
-
- &reftitle.returnvalues;
- &mongo.getreadpreference.returnvalues;
-
-
-
- &reftitle.changelog;
-
-
-
-
-
- &Version;
- &Description;
-
-
-
-
- PECL mongo 1.3.3
-
- The return value has changed to be consistent with
- MongoClient::setReadPreference. The
- type value was changed from a number to a string,
- type_string was removed, and
- tagsets now expresses tags as key/value pairs instead
- of colon-delimited strings.
-
-
-
-
-
-
-
-
-
- &reftitle.examples;
-
- MongoClient::getReadPreference return value example
-
-setReadPreference(MongoClient::RP_SECONDARY, array(
- array('dc' => 'east', 'use' => 'reporting'),
- array('dc' => 'west'),
- array(),
-));
-var_dump($m->getReadPreference());
-?>
-]]>
-
- &example.outputs;
-
-
- string(9) "secondary"
- ["tagsets"]=>
- array(3) {
- [0]=>
- array(2) {
- ["dc"]=>
- string(4) "east"
- ["use"]=>
- string(9) "reporting"
- }
- [1]=>
- array(1) {
- ["dc"]=>
- string(7) "west"
- }
- [2]=>
- array(0) {
- }
- }
-}
-]]>
-
-
-
-
-
- &reftitle.seealso;
-
- The read preferences documentation.
- MongoClient::setReadPreference
-
-
-
-
-
-
diff --git a/reference/mongo/mongoclient/getwriteconcern.xml b/reference/mongo/mongoclient/getwriteconcern.xml
deleted file mode 100644
index 42e6064aff..0000000000
--- a/reference/mongo/mongoclient/getwriteconcern.xml
+++ /dev/null
@@ -1,97 +0,0 @@
-
-
-
-
-
- MongoClient::getWriteConcern
- Get the write concern for this connection
-
-
-
- &mongo.noalternative.method.note;
-
-
-
- &reftitle.description;
-
- publicarrayMongoClient::getWriteConcern
-
-
-
-
-
- &reftitle.parameters;
- &no.function.parameters;
-
-
-
- &reftitle.returnvalues;
- &mongo.getwriteconcern.returnvalues;
-
-
-
- &reftitle.examples;
-
- MongoClient::getWriteConcern return value example
-
- 500));
-var_dump($mc->getWriteConcern());
-
-$mc->setWriteConcern(1, 1000);
-var_dump($mc->getWriteConcern());
-?>
-]]>
-
- &example.outputs;
-
-
- int(1)
- ["wtimeout"]=>
- int(500)
-}
-array(2) {
- ["w"]=>
- int(1)
- ["wtimeout"]=>
- int(1000)
-}
-]]>
-
-
-
-
-
- &reftitle.seealso;
-
- The write concern documentation.
- MongoClient::setWriteConcern
-
-
-
-
-
-
diff --git a/reference/mongo/mongoclient/killcursor.xml b/reference/mongo/mongoclient/killcursor.xml
deleted file mode 100644
index 35cda05208..0000000000
--- a/reference/mongo/mongoclient/killcursor.xml
+++ /dev/null
@@ -1,129 +0,0 @@
-
-
-
-
-
- MongoClient::killCursor
- Kills a specific cursor on the server
-
-
-
- &mongo.noalternative.method.note;
-
-
-
- &reftitle.description;
-
- publicboolMongoClient::killCursor
- stringserver_hash
- intMongoInt64id
-
-
- In certain situations it might be needed to kill a cursor on the server.
- Usually cursors time out after 10 minutes of inactivity, but it is possible
- to create an immortal cursor with
- MongoCursor::immortal that never times out. In
- order to be able to kill such an immortal cursor, you can call this
- method with the information supplied by
- MongoCursor::info.
-
-
-
-
- &reftitle.parameters;
-
-
-
-
- server_hash
-
-
-
- The server hash that has the cursor. This can be obtained through
- MongoCursor::info.
-
-
-
-
-
- id
-
-
-
- The ID of the cursor to kill. You can either supply an int
- containing the 64 bit cursor ID, or an object of the
- MongoInt64 class. The latter is necessary on 32
- bit platforms (and Windows).
-
-
-
-
-
-
-
-
- &reftitle.returnvalues;
-
- Returns &true; if the method attempted to kill a cursor, and &false; if
- there was something wrong with the arguments (such as a wrong
- server_hash). The return status does not
- reflect where the cursor was actually killed as the server does
- not provide that information.
-
-
-
-
- &reftitle.errors;
-
- This method displays a warning if the supplied
- server_hash does not match up with an existing
- connection. No attempt to kill a cursor is attempted in that case either.
-
-
-
-
- &reftitle.examples;
-
- MongoClient::killCursor example
-
- This example shows how to connect, do a query, obtain the cursor
- information and then kill the cursor.
-
-
-testdb->collection;
-$cursor = $c->find();
-$result = $cursor->next();
-
-// Now the cursor is valid, so we can get the hash and ID out:
-$info = $cursor->info();
-
-// Kill the cursor
-MongoClient::killCursor( $info['server'], $info['id'] );
-?>
-]]>
-
-
-
-
-
diff --git a/reference/mongo/mongoclient/listdbs.xml b/reference/mongo/mongoclient/listdbs.xml
deleted file mode 100644
index 929611fc7a..0000000000
--- a/reference/mongo/mongoclient/listdbs.xml
+++ /dev/null
@@ -1,102 +0,0 @@
-
-
-
-
-
- MongoClient::listDBs
- Lists all of the databases available
-
-
-
- &mongo.alternative.phplib.note;
-
- MongoDB\Client::listDatabases()
-
-
-
-
- &reftitle.description;
-
- publicarrayMongoClient::listDBs
-
-
-
-
-
- &reftitle.parameters;
- &no.function.parameters;
-
-
-
- &reftitle.returnvalues;
-
- Returns an associative array containing three fields. The first field is
- databases, which in turn contains an array. Each element
- of the array is an associative array corresponding to a database, giving th
- database's name, size, and if it's empty. The other two fields are
- totalSize (in bytes) and ok, which is 1
- if this method ran successfully.
-
-
-
-
- &reftitle.examples;
-
- MongoClient::listDBs example
-
- Example demonstrating how to use listDBs and the returned data structure.
-
-
-listDBs();
-print_r($dbs);
-
-?>
-]]>
-
- &example.outputs.similar;
-
- Array
- (
- [0] => Array
- (
- [name] => doctrine
- [sizeOnDisk] => 218103808
- [empty] =>
- )
- )
-
- [totalSize] => 218103808
- [ok] => 1
-)
-
-]]>
-
-
-
-
-
diff --git a/reference/mongo/mongoclient/selectcollection.xml b/reference/mongo/mongoclient/selectcollection.xml
deleted file mode 100644
index 98f7e76f25..0000000000
--- a/reference/mongo/mongoclient/selectcollection.xml
+++ /dev/null
@@ -1,106 +0,0 @@
-
-
-
-
-
- MongoClient::selectCollection
- Gets a database collection
-
-
-
- &mongo.alternative.phplib.note;
-
- MongoDB\Client::selectCollection()
-
-
-
-
- &reftitle.description;
-
- publicMongoCollectionMongoClient::selectCollection
- stringdb
- stringcollection
-
-
-
-
- &reftitle.parameters;
-
-
-
-
- db
-
-
-
- The database name.
-
-
-
-
-
- collection
-
-
-
- The collection name.
-
-
-
-
-
-
-
-
- &reftitle.returnvalues;
-
- Returns a new collection object.
-
-
-
-
- &reftitle.errors;
-
- Throws Exception if the database or collection name is invalid.
-
-
-
-
- &reftitle.examples;
-
- MongoClient::selectCollection example
-
-selectCollection("foo", "bar.baz");
-// which is equivalent to
-$c2 = $m->selectDB("foo")->selectCollection("bar.baz");
-
-// $c1 and $c2 now represent the same collection
-?>
-]]>
-
-
-
-
-
diff --git a/reference/mongo/mongoclient/selectdb.xml b/reference/mongo/mongoclient/selectdb.xml
deleted file mode 100644
index 35bb151a55..0000000000
--- a/reference/mongo/mongoclient/selectdb.xml
+++ /dev/null
@@ -1,76 +0,0 @@
-
-
-
-
-
- MongoClient::selectDB
- Gets a database
-
-
-
- &mongo.alternative.phplib.note;
-
- MongoDB\Client::selectDatabase()
-
-
-
-
- &reftitle.description;
-
- publicMongoDBMongoClient::selectDB
- stringname
-
-
-
-
- &reftitle.parameters;
-
-
-
-
- name
-
-
-
- The database name.
-
-
-
-
-
-
-
-
- &reftitle.returnvalues;
-
- Returns a new database object.
-
-
-
-
- &reftitle.errors;
-
- Throws Exception if the database name is invalid.
-
-
-
-
-
diff --git a/reference/mongo/mongoclient/setreadpreference.xml b/reference/mongo/mongoclient/setreadpreference.xml
deleted file mode 100644
index 4ded1e24a2..0000000000
--- a/reference/mongo/mongoclient/setreadpreference.xml
+++ /dev/null
@@ -1,89 +0,0 @@
-
-
-
-
-
- MongoClient::setReadPreference
- Set the read preference for this connection
-
-
-
- &mongo.noalternative.method.note;
-
-
-
- &reftitle.description;
-
- publicboolMongoClient::setReadPreference
- stringread_preference
- arraytags
-
-
-
-
- &reftitle.parameters;
- &mongo.setreadpreference.parameters;
-
-
-
- &reftitle.returnvalues;
- &mongo.setreadpreference.returnvalues;
-
-
-
- &reftitle.errors;
- &mongo.setreadpreference.errors;
-
-
-
- &reftitle.examples;
-
- MongoClient::setReadPreference tag set array syntax example
-
-setReadPreference(MongoClient::RP_NEAREST, array(
- array('dc' => 'east', 'use' => 'reporting'),
- array('dc' => 'west'),
-));
-?>
-]]>
-
-
-
-
-
- &reftitle.seealso;
-
- The read preferences documentation.
- MongoClient::getReadPreference
-
-
-
-
-
-
diff --git a/reference/mongo/mongoclient/setwriteconcern.xml b/reference/mongo/mongoclient/setwriteconcern.xml
deleted file mode 100644
index b8b2e9b3bf..0000000000
--- a/reference/mongo/mongoclient/setwriteconcern.xml
+++ /dev/null
@@ -1,86 +0,0 @@
-
-
-
-
-
- MongoClient::setWriteConcern
- Set the write concern for this connection
-
-
-
- &mongo.noalternative.method.note;
-
-
-
- &reftitle.description;
-
- publicboolMongoClient::setWriteConcern
- mixedw
- intwtimeout
-
-
-
-
- &reftitle.parameters;
- &mongo.setwriteconcern.parameters;
-
-
-
- &reftitle.returnvalues;
- &mongo.setwriteconcern.returnvalues;
-
-
-
- &reftitle.errors;
- &mongo.setwriteconcern.errors;
-
-
-
- &reftitle.examples;
-
- MongoClient::setWriteConcern example
-
-setWriteConcern('majority', 3000);
-?>
-]]>
-
-
-
-
-
- &reftitle.seealso;
-
- The write concern documentation.
- MongoClient::getWriteConcern
-
-
-
-
-
-
diff --git a/reference/mongo/mongoclient/tostring.xml b/reference/mongo/mongoclient/tostring.xml
deleted file mode 100644
index 20c3d84afa..0000000000
--- a/reference/mongo/mongoclient/tostring.xml
+++ /dev/null
@@ -1,52 +0,0 @@
-
-
-
-
-
- MongoClient::__toString
- String representation of this connection
-
-
-
- &mongo.noalternative.method.note;
-
-
-
- &reftitle.description;
-
- publicstringMongoClient::__toString
-
-
-
-
-
- &reftitle.parameters;
- &no.function.parameters;
-
-
-
- &reftitle.returnvalues;
-
- Returns hostname and port for this connection.
-
-
-
-
diff --git a/reference/mongo/mongocode.xml b/reference/mongo/mongocode.xml
deleted file mode 100644
index 33e4b5f0c7..0000000000
--- a/reference/mongo/mongocode.xml
+++ /dev/null
@@ -1,77 +0,0 @@
-
-
-
-
-
- The MongoCode class
- MongoCode
-
-
-
-
- &mongo.alternative.class.note;
-
- MongoDB\BSON\JavaScript
-
-
-
-
-
- &reftitle.intro;
-
- Represents JavaScript code for the database.
-
-
- MongoCode objects are composed of two parts: a string of code and an optional scope. The string of code must be valid JavaScript. The scope is a associative array of variable name/value pairs.
-
-
-
-
-
- &reftitle.classsynopsis;
-
-
-
- MongoCode
-
-
-
-
- MongoCode
-
-
-
-
- &Methods;
-
-
-
-
-
-
-
-
- &reference.mongo.entities.mongocode;
-
-
-
-
diff --git a/reference/mongo/mongocode/construct.xml b/reference/mongo/mongocode/construct.xml
deleted file mode 100644
index d218290d7a..0000000000
--- a/reference/mongo/mongocode/construct.xml
+++ /dev/null
@@ -1,137 +0,0 @@
-
-
-
-
-
- MongoCode::__construct
- Creates a new code object
-
-
-
-
- &mongo.alternative.method.note;
-
- MongoDB\BSON\JavaScript::__construct
-
-
-
-
-
- &reftitle.description;
-
- publicMongoCode::__construct
- stringcode
- arrayscopearray()
-
-
-
-
- &reftitle.parameters;
-
-
-
-
- code
-
-
-
- A string of code.
-
-
-
-
-
- scope
-
-
-
- The scope to use for the code.
-
-
-
-
-
-
-
-
- &reftitle.returnvalues;
-
- Returns a new code object.
-
-
-
-
- &reftitle.examples;
-
- MongoCode::__construct example
-
- 4));
-var_dump($code);
-
-?>
-]]>
-
- &example.outputs.similar;
-
-
- array(1) {
- ["x"]=>
- int(4)
- }
- ["code"]=>
- string(80) "function() { for(i=0;i<10;i++) { db.foo.update({z : i}, {z : x}); } return x-1; }"
-}
-]]>
-
-
-
-
-
- Using MongoCode with $where
-
- This example queries a collection for elements where the 'x' fields is less than $y. Notice that
- PHP objects can be passed into the JavaScript scope and that the JavaScript function returns a boolean.
-
-
-find(array('$where' => new MongoCode('function() { return this.x < y; }', array('y'=>$y))));
-
-?>
-]]>
-
-
-
-
-
-
diff --git a/reference/mongo/mongocode/tostring.xml b/reference/mongo/mongocode/tostring.xml
deleted file mode 100644
index b99e781bdf..0000000000
--- a/reference/mongo/mongocode/tostring.xml
+++ /dev/null
@@ -1,83 +0,0 @@
-
-
-
-
-
- MongoCode::__toString
- Returns this code as a string
-
-
-
-
- &mongo.noalternative.method.note;
-
-
-
-
- &reftitle.description;
-
- publicstringMongoCode::__toString
-
-
-
-
-
- &reftitle.parameters;
- &no.function.parameters;
-
-
-
- &reftitle.returnvalues;
-
- This code, the scope is not returned.
-
-
-
-
- &reftitle.examples;
-
- MongoCode::__toString example
-
-"hi"));
-echo "$code\n";
-
-$code = new MongoCode('function() { for(i=0;i<10;i++) { db.foo.update({x:i}, {x:i+1}); } }');
-echo "$code\n";
-
-?>
-]]>
-
- &example.outputs.similar;
-
-
-
-
-
-
-
-
diff --git a/reference/mongo/mongocollection.xml b/reference/mongo/mongocollection.xml
deleted file mode 100644
index 5326fedc9c..0000000000
--- a/reference/mongo/mongocollection.xml
+++ /dev/null
@@ -1,175 +0,0 @@
-
-
-
-
-
- The MongoCollection class
- MongoCollection
-
-
-
-
-
- &reftitle.intro;
-
- Represents a MongoDB collection.
-
-
- Collection names can use any character in the ASCII set. Some valid
- collection names are "", "...",
- "my collection", and "*&#@".
-
-
- User-defined collection names cannot contain the $ symbol. There are
- certain system collections which use a $ in their names (e.g.,
- local.oplog.$main), but it is a reserved character. If you attempt to
- create and use a collection with a $ in the name, MongoDB will assert.
-
-
-
-
-
- &reftitle.classsynopsis;
-
-
-
- MongoCollection
-
-
-
-
- MongoCollection
-
-
-
-
- &Constants;
-
- const
- int
- MongoCollection::ASCENDING
- 1
-
-
- const
- int
- MongoCollection::DESCENDING
- -1
-
-
- Fields
-
- public
- MongoDB
- db
- &null;
-
-
- public
- int
- w
-
-
- public
- int
- wtimeout
-
-
- &Methods;
-
-
-
-
-
-
-
- &reftitle.constants;
-
-
- MongoCollection::ASCENDING
-
-
- Ascending direction for sorts and index creation.
-
-
-
-
- MongoCollection::DESCENDING
-
-
- Descending direction for sorts and index creation.
-
-
-
-
-
-
-
- Fields
-
-
- db
-
-
- The "parent" database for this collection.
-
-
-
-
- w
-
-
- The number of servers to replicate a change to before returning success.
- Value is inherited from the parent database. The
- MongoDB class has a more detailed description of
- how w works.
-
-
-
-
- wtimeout
-
-
- The number of milliseconds to wait for $this->w
- replications to take place. Value is inherited from the parent database.
- The MongoDB class has a more detailed description
- of how wtimeout works.
-
-
-
-
-
-
-
- &reftitle.seealso;
-
- MongoDB core docs on collections.
-
-
-
-
-
- &reference.mongo.entities.mongocollection;
-
-
-
-
diff --git a/reference/mongo/mongocollection/aggregate.xml b/reference/mongo/mongocollection/aggregate.xml
deleted file mode 100644
index fec8d36104..0000000000
--- a/reference/mongo/mongocollection/aggregate.xml
+++ /dev/null
@@ -1,570 +0,0 @@
-
-
-
-
-
- MongoCollection::aggregate
- Perform an aggregation using the aggregation framework
-
-
-
- &reftitle.description;
-
- publicarrayMongoCollection::aggregate
- arraypipeline
- arrayoptions
-
-
- publicarrayMongoCollection::aggregate
- arrayop
- arrayops
-
-
- The MongoDB
- aggregation framework
- provides a means to calculate aggregated values without having to use
- MapReduce. While MapReduce is powerful, it is often more difficult than
- necessary for many simple aggregation tasks, such as totaling or averaging
- field values.
-
-
- This method accepts either a variable amount of pipeline operators, or a
- single array of operators constituting the pipeline.
-
-
-
-
- &reftitle.parameters;
-
-
- pipeline
-
-
- An array of pipeline operators.
-
-
-
-
- options
-
- Options for the aggregation command. Valid options include:
-
-
- "allowDiskUse"
- Allow aggregation stages to write to temporary files
-
-
- "cursor"
-
- Options controlling the creation of the cursor object. This option
- causes the command to return a result document suitable for constructing
- a MongoCommandCursor. If you need to use this
- option, you should consider using
- MongoCollection::aggregateCursor.
-
-
-
- "explain"
- Return information on the processing of the pipeline.
-
- &mongo.command.parameters.maxtimems;
-
-
-
-
- Or
-
-
- op
-
-
- First pipeline operator.
-
-
-
-
- ops
-
-
- Additional pipeline operators.
-
-
-
-
-
-
-
- &reftitle.returnvalues;
-
- The result of the aggregation as an array. The ok will
- be set to 1 on success, 0 on failure.
-
-
-
-
- &reftitle.errors;
-
- When an error occurs an array with the following keys will be returned:
-
-
-
- errmsg - containing the reason for the failure
-
-
-
-
- code - the errorcode of the failure
-
-
-
-
- ok - will be set to 0.
-
-
-
-
-
-
-
- &reftitle.changelog;
-
-
-
-
- &Version;
- &Description;
-
-
-
-
- PECL mongo 1.5.0
-
- Added optional options argument
-
-
-
-
-
-
-
-
- &reftitle.examples;
-
- MongoCollection::aggregate example
-
- The following example aggregation operation pivots data to create a set of
- author names grouped by tags applied to an article. Call the aggregation
- framework by issuing the following command:
-
-
-selectDB("examples")->selectCollection("article");
-$data = array (
- 'title' => 'this is my title',
- 'author' => 'bob',
- 'posted' => new MongoDate,
- 'pageViews' => 5,
- 'tags' => array ( 'fun', 'good', 'fun' ),
- 'comments' => array (
- array (
- 'author' => 'joe',
- 'text' => 'this is cool',
- ),
- array (
- 'author' => 'sam',
- 'text' => 'this is bad',
- ),
- ),
- 'other' =>array (
- 'foo' => 5,
- ),
-);
-$d = $c->insert($data, array("w" => 1));
-
-$ops = array(
- array(
- '$project' => array(
- "author" => 1,
- "tags" => 1,
- )
- ),
- array('$unwind' => '$tags'),
- array(
- '$group' => array(
- "_id" => array("tags" => '$tags'),
- "authors" => array('$addToSet' => '$author'),
- ),
- ),
-);
-$results = $c->aggregate($ops);
-var_dump($results);
-?>
-]]>
-
- &example.outputs;
-
-
- array(2) {
- [0]=>
- array(2) {
- ["_id"]=>
- array(1) {
- ["tags"]=>
- string(4) "good"
- }
- ["authors"]=>
- array(1) {
- [0]=>
- string(3) "bob"
- }
- }
- [1]=>
- array(2) {
- ["_id"]=>
- array(1) {
- ["tags"]=>
- string(3) "fun"
- }
- ["authors"]=>
- array(1) {
- [0]=>
- string(3) "bob"
- }
- }
- }
- ["ok"]=>
- float(1)
-}
-]]>
-
-
-
-
- The following examples use the zipcode data set.
- Use mongoimport to load this data set into your mongod instance.
-
-
-
- MongoCollection::aggregate example
-
- To return all states with a population greater than 10 million, use the following aggregation operation:
-
-
-selectDB("test")->selectCollection("zips");
-
-$pipeline = array(
- array(
- '$group' => array(
- '_id' => array('state' => '$state'),
- 'totalPop' => array('$sum' => '$pop')
- )
- ),
- array(
- '$match' => array(
- 'totalPop' => array('$gte' => 10 * 1000 * 1000)
- )
- ),
-);
-$out = $c->aggregate($pipeline);
-var_dump($out);
-?>
-]]>
-
- &example.outputs.similar;
-
-
- array(7) {
- [0]=>
- array(2) {
- ["_id"]=>
- string(2) "TX"
- ["totalPop"]=>
- int(16986510)
- }
- [1]=>
- array(2) {
- ["_id"]=>
- string(2) "PA"
- ["totalPop"]=>
- int(11881643)
- }
- [2]=>
- array(2) {
- ["_id"]=>
- string(2) "NY"
- ["totalPop"]=>
- int(17990455)
- }
- [3]=>
- array(2) {
- ["_id"]=>
- string(2) "IL"
- ["totalPop"]=>
- int(11430602)
- }
- [4]=>
- array(2) {
- ["_id"]=>
- string(2) "CA"
- ["totalPop"]=>
- int(29760021)
- }
- [5]=>
- array(2) {
- ["_id"]=>
- string(2) "OH"
- ["totalPop"]=>
- int(10847115)
- }
- [6]=>
- array(2) {
- ["_id"]=>
- string(2) "FL"
- ["totalPop"]=>
- int(12937926)
- }
- }
- ["ok"]=>
- float(1)
-}
-]]>
-
-
-
-
- MongoCollection::aggregate example
-
- To return the average populations for cities in each state, use the following aggregation operation:
-
-
-selectDB("test")->selectCollection("zips");
-
-$out = $c->aggregate(
- array(
- '$group' => array(
- '_id' => array('state' => '$state', 'city' => '$city' ),
- 'pop' => array('$sum' => '$pop' )
- )
- ),
- array(
- '$group' => array(
- '_id' => '$_id.state',
- 'avgCityPop' => array('$avg' => '$pop')
- )
- )
-);
-
-var_dump($out);
-?>
-]]>
-
- &example.outputs.similar;
-
-
- array(51) {
- [0]=>
- array(2) {
- ["_id"]=>
- string(2) "DC"
- ["avgCityPop"]=>
- float(303450)
- }
- [1]=>
- array(2) {
- ["_id"]=>
- string(2) "DE"
- ["avgCityPop"]=>
- float(14481.913043478)
- }
-...
- [49]=>
- array(2) {
- ["_id"]=>
- string(2) "WI"
- ["avgCityPop"]=>
- float(7323.0074850299)
- }
- [50]=>
- array(2) {
- ["_id"]=>
- string(2) "WV"
- ["avgCityPop"]=>
- float(2759.1953846154)
- }
- }
- ["ok"]=>
- float(1)
-}
-]]>
-
-
-
-
- MongoCollection::aggregate with command options
-
- To return information on how the pipeline will be processed we use the
- explain command option:
-
-
-selectDB("test")->selectCollection("zips");
-
-$pipeline = array(
- array(
- '$group' => array(
- '_id' => '$state',
- 'totalPop' => array('$sum' => '$pop'),
- ),
- ),
- array(
- '$match' => array(
- 'totalPop' => array('$gte' => 10 * 1000 * 1000)
- )
- ),
- array(
- '$sort' => array("totalPop" => -1),
- ),
-);
-
-$options = array("explain" => true);
-$out = $c->aggregate($pipeline, $options);
-var_dump($out);
-?>
-]]>
-
- &example.outputs.similar;
-
-
- array(4) {
- [0]=>
- array(1) {
- ["$cursor"]=>
- array(3) {
- ["query"]=>
- array(0) {
- }
- ["fields"]=>
- array(3) {
- ["pop"]=>
- int(1)
- ["state"]=>
- int(1)
- ["_id"]=>
- int(0)
- }
- ["plan"]=>
- array(4) {
- ["cursor"]=>
- string(11) "BasicCursor"
- ["isMultiKey"]=>
- bool(false)
- ["scanAndOrder"]=>
- bool(false)
- ["allPlans"]=>
- array(1) {
- [0]=>
- array(3) {
- ["cursor"]=>
- string(11) "BasicCursor"
- ["isMultiKey"]=>
- bool(false)
- ["scanAndOrder"]=>
- bool(false)
- }
- }
- }
- }
- }
- [1]=>
- array(1) {
- ["$group"]=>
- array(2) {
- ["_id"]=>
- string(6) "$state"
- ["totalPop"]=>
- array(1) {
- ["$sum"]=>
- string(4) "$pop"
- }
- }
- }
- [2]=>
- array(1) {
- ["$match"]=>
- array(1) {
- ["totalPop"]=>
- array(1) {
- ["$gte"]=>
- int(10000000)
- }
- }
- }
- [3]=>
- array(1) {
- ["$sort"]=>
- array(1) {
- ["sortKey"]=>
- array(1) {
- ["totalPop"]=>
- int(-1)
- }
- }
- }
- }
- ["ok"]=>
- float(1)
-}
-]]>
-
-
-
-
-
-
- &reftitle.seealso;
-
- MongoCollection::aggregateCursor
- The MongoDB aggregation framework
-
-
-
-
-
-
diff --git a/reference/mongo/mongocollection/aggregatecursor.xml b/reference/mongo/mongocollection/aggregatecursor.xml
deleted file mode 100644
index 2ee38d5364..0000000000
--- a/reference/mongo/mongocollection/aggregatecursor.xml
+++ /dev/null
@@ -1,232 +0,0 @@
-
-
-
-
-
- MongoCollection::aggregateCursor
- Execute an aggregation pipeline command and retrieve results through a cursor
-
-
- &reftitle.description;
-
- publicMongoCommandCursorMongoCollection::aggregateCursor
- arraycommand
- arrayoptions
-
-
- With this method you can execute Aggregation Framework pipelines and
- retrieve the results through a cursor, instead of getting just one document
- back as you would with MongoCollection::aggregate.
- This method returns a MongoCommandCursor object.
- This cursor object implements the Iterator interface
- just like the MongoCursor objects that are returned
- by the MongoCollection::find method.
-
-
-
- The resulting MongoCommandCursor will inherit this
- collection's read preference.
- MongoCommandCursor::setReadPreference may be used
- to change the read preference before iterating on the cursor.
-
-
-
-
-
- &reftitle.parameters;
-
-
-
-
- pipeline
-
-
-
- The Aggregation Framework pipeline to execute.
-
-
-
-
- options
-
- Options for the aggregation command. Valid options include:
-
-
- "allowDiskUse"
- Allow aggregation stages to write to temporary files
-
-
- "cursor"
-
- It is possible to configure how many initial documents the server
- should return with the first result set. The default initial batch size
- is 101. You can change it by adding the
- batchSize option:
-
-
-aggregateCursor(
- $pipeline,
- [ "cursor" => [ "batchSize" => 4 ] ]
-);
-]]>
-
-
- This option only configures the size of the first batch. To configure
- the size of future batches, please use the
- MongoCommandCursor::batchSize method on the
- returned MongoCommandCursor object.
-
-
-
- "explain"
-
- Return information on the processing of the pipeline. This option may
- cause the command to return a result document that is unsuitable for
- constructing a MongoCommandCursor. If you need
- to use this option, you should consider using
- MongoCollection::aggregate.
-
-
- &mongo.command.parameters.maxtimems;
-
-
-
-
-
-
-
-
- &reftitle.returnvalues;
-
- Returns a MongoCommandCursor object. Because this
- implements the Iterator interface you can
- iterate over each of the results as returned by the command query. The
- MongoCommandCursor also implements the
- MongoCursorInterface interface which adds the
- MongoCommandCursor::batchSize,
- MongoCommandCursor::dead,
- MongoCommandCursor::info methods.
-
-
-
-
- &reftitle.examples;
-
- MongoCollection::aggregateCursor example
-
- Finding all of the distinct values for a key.
-
-
-test;
-$people = $db->people;
-$people->drop();
-
-$people->insert(array("name" => "Joe", "points" => 4));
-$people->insert(array("name" => "Molly", "points" => 43));
-$people->insert(array("name" => "Sally", "points" => 22));
-$people->insert(array("name" => "Joe", "points" => 22));
-$people->insert(array("name" => "Molly", "points" => 87));
-
-$ages = $people->aggregateCursor( [
- [ '$group' => [ '_id' => '$name', 'points' => [ '$sum' => '$points' ] ] ],
- [ '$sort' => [ 'points' => -1 ] ],
-] );
-
-foreach ($ages as $person) {
- echo "{$person['_id']}: {$person['points']}\n";
-}
-
-?>
-]]>
-
- &example.outputs.similar;
-
-Molly: 130
-Joe: 26
-Sally: 22
-
-
-
-
- MongoCollection::aggregateCursor
- example with different initial batch size
-
- Finding all of the distinct values for a key.
-
-
-test;
-$people = $db->people;
-$people->drop();
-
-/* Insert some sample data */
-$people->insert(array("name" => "Joe", "points" => 4));
-$people->insert(array("name" => "Molly", "points" => 43));
-$people->insert(array("name" => "Sally", "points" => 22));
-$people->insert(array("name" => "Joe", "points" => 22));
-$people->insert(array("name" => "Molly", "points" => 87));
-
-/* Run the command cursor */
-$ages = $people->aggregateCursor(
- [
- [ '$group' => [ '_id' => '$name', 'points' => [ '$sum' => '$points' ] ] ],
- [ '$sort' => [ 'points' => -1 ] ],
- ],
- [ "cursor" => [ "batchSize" => 4 ] ]
-);
-
-foreach ($ages as $person) {
- echo "{$person['_id']}: {$person['points']}\n";
-}
-
-?>
-]]>
-
- &example.outputs.similar;
-
-Molly: 130
-Joe: 26
-Sally: 22
-
-
-
-
-
- &reftitle.seealso;
-
-
- MongoDB::command
- MongoCommandCursor
- MongoCommandCursor::batchSize
- MongoCollection::aggregate
- The MongoDB aggregation framework
-
-
-
-
-
diff --git a/reference/mongo/mongocollection/batchinsert.xml b/reference/mongo/mongocollection/batchinsert.xml
deleted file mode 100644
index 7ed8e984c0..0000000000
--- a/reference/mongo/mongocollection/batchinsert.xml
+++ /dev/null
@@ -1,316 +0,0 @@
-
-
-
-
-
- MongoCollection::batchInsert
- Inserts multiple documents into this collection
-
-
-
- &reftitle.description;
-
- publicmixedMongoCollection::batchInsert
- arraya
- arrayoptionsarray()
-
-
-
-
- &reftitle.parameters;
-
-
-
-
- a
-
-
-
- An array of arrays or objects. If any objects are used, they may not have
- protected or private properties.
-
-
-
- If the documents to insert do not have an _id key or
- property, a new MongoId instance will be created
- and assigned to it. See MongoCollection::insert for
- additional information on this behavior.
-
-
-
-
-
-
- options
-
-
-
- An array of options for the batch of insert operations. Currently
- available options include:
-
-
-
- "continueOnError"
-
-
- Boolean, defaults to &false;. If set, the database will not stop
- processing a bulk insert if one fails (eg due to duplicate IDs).
- This makes bulk insert behave similarly to a series of single
- inserts, except that calling MongoDB::lastError
- will have an error set if any insert fails, not just the last one.
- If multiple errors occur, only the most recent will be reported by
- MongoDB::lastError.
-
-
-
- Please note that continueOnError affects errors
- on the database side only. If you try to insert a document that has
- errors (for example it contains a key with an empty name), then the
- document is not even transferred to the database as the driver
- detects this error and bails out.
- continueOnError has no effect on errors detected
- in the documents by the driver.
-
-
-
- &mongo.writes.parameters.fsync;
- &mongo.writes.parameters.journal;
- &mongo.writes.parameters.sockettimeoutms;
- &mongo.writes.parameters.writeconcern;
- &mongo.writes.parameters.writeconcerntimeoutms;
-
-
-
- The following options are deprecated and should no longer be used:
-
- &mongo.writes.parameters.safe;
- &mongo.writes.parameters.timeout;
- &mongo.writes.parameters.writeconcerntimeout;
-
-
-
-
-
-
-
-
-
- &reftitle.returnvalues;
-
- If the w parameter is set to acknowledge the write,
- returns an associative array with the status of the inserts ("ok") and any
- error that may have occurred ("err"). Otherwise, returns &true; if the
- batch insert was successfully sent, &false; otherwise.
-
-
-
-
- &reftitle.errors;
-
- Throws MongoException if any inserted documents are
- empty or if they contains zero-length keys. Attempting to insert an object
- with protected and private properties will cause a zero-length key error.
-
- &mongo.errors.exceptions.writeconcern;
-
-
-
- &reftitle.changelog;
-
-
-
-
-
- &Version;
- &Description;
-
-
-
-
- PECL mongo 1.5.0
-
-
- Added the "wTimeoutMS" option, which replaces
- "wtimeout". Emits E_DEPRECATED
- when "wtimeout" is used.
-
-
- Added the "socketTimeoutMS" option, which replaces
- "timeout". Emits E_DEPRECATED
- when "timeout" is used.
-
-
- Emits E_DEPRECATED when "safe"
- is used.
-
-
-
-
- PECL mongo 1.3.4
- Added "wtimeout" option.
-
-
- PECL mongo 1.3.0
- Added "w" option.
-
-
- PECL mongo 1.2.7
- Added "continueOnError" option.
-
-
- PECL mongo 1.0.9
-
-
- Added ability to pass integers to the "safe" option,
- which previously only accepted booleans.
-
-
- Added "fsync" option.
-
-
-
-
- PECL mongo 1.0.5
- Added options parameter.
-
-
-
-
-
-
-
-
- &reftitle.examples;
-
- MongoCollection::batchInsert example
-
- Batch insertion is a quick way to add many elements to the database at once
-
-
- 'user'.$i, 'i' => $i);
-}
-
-$mongo = new MongoClient();
-$collection = $mongo->my_db->users;
-$collection->drop();
-
-$collection->batchInsert($users);
-
-foreach ($users as $user) {
- echo $user['_id']."\n"; // populated with instanceof MongoId
-}
-
-$users = $collection->find()->sort(array('i' => 1));
-foreach ($users as $user) {
- var_dump($user['username']);
-}
-
-?>
-]]>
-
- &example.outputs.similar;
-
-
-
-
-
-
- MongoCollection::batchInsert example with
- ignoring errors
-
-demo;
-
-$doc1 = array(
- '_id' => new MongoId('4cb4ab6d7addf98506010001'),
- 'id' => 1,
- 'desc' => "ONE",
-);
-$doc2 = array(
- '_id' => new MongoId('4cb4ab6d7addf98506010002'),
- 'id' => 2,
- 'desc' => "TWO",
-);
-$doc3 = array(
- '_id' => new MongoId('4cb4ab6d7addf98506010002'), // same _id as above
- 'id' => 3,
- 'desc' => "THREE",
-);
-$doc4 = array(
- '_id' => new MongoId('4cb4ab6d7addf98506010004'),
- 'id' => 4,
- 'desc' => "FOUR",
-);
-
-$c = $db->selectCollection('c');
-$c->batchInsert(
- array($doc1, $doc2, $doc3, $doc4),
- array('continueOnError' => true)
-);
-
-$docs = $c->find();
-foreach ($docs as $doc) {
- var_dump($doc['desc']);
-}
-?>
-]]>
-
- &example.outputs.similar;
-
-
-
-
-
-
-
- &reftitle.seealso;
-
- MongoCollection::insert
- MongoCollection::update
- MongoCollection::find
- MongoCollection::remove
- MongoDB core docs on insert.
-
-
-
-
-
diff --git a/reference/mongo/mongocollection/construct.xml b/reference/mongo/mongocollection/construct.xml
deleted file mode 100644
index fcc9df9d25..0000000000
--- a/reference/mongo/mongocollection/construct.xml
+++ /dev/null
@@ -1,83 +0,0 @@
-
-
-
-
-
- MongoCollection::__construct
- Creates a new collection
-
-
-
-
- &reftitle.description;
-
- publicMongoCollection::__construct
- MongoDBdb
- stringname
-
-
-
-
- &reftitle.parameters;
-
-
-
-
- MongoDB
- db
-
-
-
- Parent database.
-
-
-
-
-
-
-
- name
-
-
-
- Name for this collection.
-
-
-
-
-
-
-
-
- &reftitle.returnvalues;
-
- Returns a new collection object.
-
-
-
-
- &reftitle.errors;
-
- Throws default exception if the collection name is invalid.
-
-
-
-
diff --git a/reference/mongo/mongocollection/count.xml b/reference/mongo/mongocollection/count.xml
deleted file mode 100644
index 6932118b61..0000000000
--- a/reference/mongo/mongocollection/count.xml
+++ /dev/null
@@ -1,197 +0,0 @@
-
-
-
-
-
- MongoCollection::count
- Counts the number of documents in this collection
-
-
-
- &reftitle.description;
-
- publicintMongoCollection::count
- arrayqueryarray()
- arrayoptionsarray()
-
-
-
-
- &reftitle.parameters;
-
-
-
-
- query
-
-
-
- Associative array or object with fields to match.
-
-
-
-
-
- options
-
-
-
- An array of options for the index creation. Currently available options
- include:
-
-
-
-
- &Name;
- &Type;
- &Description;
-
-
-
-
- hint
- mixed
-
-
- Index to use for the query. If a string is passed, it should
- correspond to an index name. If an array or object is passed, it
- should correspond to the specification used to create the index
- (i.e. the first argument to
- MongoCollection::createIndex).
-
- This option is only supported in MongoDB 2.6+.
-
-
-
- limit
- int
- The maximum number of matching documents to return.
-
-
- maxTimeMS
- int
-
-
- Specifies a cumulative time limit in milliseconds for processing
- the operation (does not include idle time). If the operation is not
- completed within the timeout period, a
- MongoExecutionTimeoutException will be
- thrown.
-
- This option is only supported in MongoDB 2.6+.
-
-
-
- skip
- int
- The number of matching documents to skip before returning results.
-
-
-
-
-
-
-
-
-
-
-
-
- &reftitle.returnvalues;
-
- Returns the number of documents matching the query.
-
-
-
-
- &reftitle.errors;
-
- Throws MongoResultException if the server could not
- execute the command due to an error.
-
-
- Throws MongoExecutionTimeoutException if command
- execution was terminated due to maxTimeMS.
-
-
-
-
- &reftitle.changelog;
-
-
-
-
-
- &Version;
- &Description;
-
-
-
-
- PECL mongo 1.6.0
-
- The second parameter is now an options array.
- Passing limit and skip as
- the second and third parameters, respectively, is deprecated.
-
-
-
- PECL mongo 1.0.7
-
- Added limit and skip as
- second and third parameters, respectively.
-
-
-
-
-
-
-
-
-
- &reftitle.examples;
-
- MongoCollection::count example
-
-insert(array('x'=>1));
-$collection->insert(array('x'=>2));
-$collection->insert(array('x'=>3));
-
-var_dump($collection->count());
-var_dump($collection->count(array('x'=>1)));
-
-?>
-]]>
-
- &example.outputs.similar;
-
-
-
-
-
-
-
diff --git a/reference/mongo/mongocollection/createdbref.xml b/reference/mongo/mongocollection/createdbref.xml
deleted file mode 100644
index 9bbdfe16e2..0000000000
--- a/reference/mongo/mongocollection/createdbref.xml
+++ /dev/null
@@ -1,101 +0,0 @@
-
-
-
-
-
- MongoCollection::createDBRef
- Creates a database reference
-
-
-
- &reftitle.description;
-
- publicarrayMongoCollection::createDBRef
- mixeddocument_or_id
-
-
-
-
- &reftitle.parameters;
-
-
-
-
- document_or_id
-
-
-
- If an array or object is given, its _id field will be
- used as the reference ID. If a MongoId or scalar
- is given, it will be used as the reference ID.
-
-
-
-
-
-
-
-
- &reftitle.returnvalues;
-
- Returns a database reference array.
-
-
- If an array without an _id field was provided as the
- document_or_id parameter, &null; will be returned.
-
-
-
-
- &reftitle.examples;
-
- MongoCollection::createDBRef example
-
-songs;
-$playlists = $db->playlists;
-
-// create a reference to a song
-$manamana = $songs->findOne(array('title' => 'Ma na ma na'));
-$refToSong = $songs->createDBRef($manamana);
-
-// add the reference to my playlist
-$playlists->update(array('username' => 'me'), array('$push' => array('songlist' => $refToSong)));
-
-?>
-]]>
-
-
-
-
-
- &reftitle.seealso;
-
-
- MongoCollection::getDBRef
-
-
-
-
-
-
diff --git a/reference/mongo/mongocollection/createindex.xml b/reference/mongo/mongocollection/createindex.xml
deleted file mode 100644
index 9af054beca..0000000000
--- a/reference/mongo/mongocollection/createindex.xml
+++ /dev/null
@@ -1,248 +0,0 @@
-
-
-
-
-
- MongoCollection::createIndex
-
- Creates an index on the specified field(s) if it does not already exist
-
-
-
-
- &reftitle.description;
-
- publicboolMongoCollection::createIndex
- arraykeys
- arrayoptionsarray()
-
-
- Creates an index on the specified field(s) if it does not already exist.
- Fields may be indexed with a direction (e.g. ascending or descending) or a
- special type (e.g. text, geospatial, hashed).
-
-
-
- This method will use the
- createIndexes
- database command when communicating with MongoDB 2.6+. For previous database
- versions, the method will perform an insert operation on the
- special system.indexes collection.
-
-
-
-
-
- &reftitle.parameters;
-
-
-
-
- keys
-
-
-
- An array specifying the index's fields as its keys. For each field, the
- value is either the index direction or
- index type.
- If specifying direction, specify 1 for ascending or
- -1 for descending.
-
-
-
-
-
- options
-
-
-
- An array of options for the index creation. We pass all given options
- straight to the server, but a non-exhaustive list of currently
- available options include:
-
- &mongo.index.parameters.unique;
- &mongo.index.parameters.sparse;
- &mongo.index.parameters.expireafterseconds;
- &mongo.index.parameters.name;
- &mongo.index.parameters.background;
- &mongo.writes.parameters.sockettimeoutms;
-
-
-
- The following option may be used with MongoDB 2.6+:
-
- &mongo.command.parameters.maxtimems;
-
-
-
- The following options may be used with MongoDB versions before 2.8:
-
- &mongo.index.parameters.dropdups;
-
-
-
- The following options may be used with MongoDB versions before 2.6:
-
- &mongo.writes.parameters.writeconcern;
- &mongo.writes.parameters.writeconcerntimeoutms;
-
-
-
- The following options are deprecated and should no longer be used:
-
- &mongo.writes.parameters.safe;
- &mongo.writes.parameters.timeout;
- &mongo.writes.parameters.writeconcerntimeout;
-
-
-
-
-
-
-
-
-
- &reftitle.returnvalues;
-
- Returns an array containing the status of the index creation. The array
- contains whether the operation succeeded ("ok"), the
- number of indexes before and after the operation
- ("numIndexesBefore" and
- "numIndexesAfter"), and whether the collection that the
- index belongs to has been created
- ("createdCollectionAutomatically"). If the index already
- existed and did not need to be created, a "note" field may
- be present in lieu of "numIndexesAfter".
-
-
- With MongoDB 2.4 and earlier, a status document is only returned if the
- write concern is at least
- 1. Otherwise, &true; is returned. The fields in the status
- document are different, except for the "ok" field, which
- signals whether the index creation was successful. Additional fields are
- described in the documentation for
- MongoCollection::insert.
-
-
-
-
- &reftitle.errors;
-
- Throws MongoException if the index name is longer
- than 128 bytes, or if the index specification is not an array.
-
-
- Throws MongoDuplicateKeyException if the server could not
- create the unique index due to conflicting documents.
-
-
- Throws MongoResultException if the server could not
- create the index due to an error.
-
- &mongo.errors.exceptions.writeconcern;
-
-
-
- &reftitle.examples;
-
- MongoCollection::createIndex example
-
-createIndex(array('x' => 1));
-
-// create a unique index on 'y'
-$c->createIndex(array('y' => 1), array('unique' => true));
-
-// create a compound index on 'za' ascending and 'zb' descending
-$c->createIndex(array('za' => 1, 'zb' => -1));
-
-?>
-]]>
-
-
-
- Geospatial Indexing
-
- Mongo supports geospatial indexes, which allow you to search for documents
- near a given location or within a shape. The following example creates a
- geospatial index on the "loc" field:
-
-
-createIndex(array('loc' => '2dsphere'));
-
-?>
-]]>
-
-
-
- Drop duplicates example
-
-insert(array('username' => 'joeschmoe'));
-$collection->insert(array('username' => 'joeschmoe'));
-
-/* Index creation fails, since you cannot create a unique index on a field when
- * duplicates exist.
- */
-$collection->createIndex(array('username' => 1), array('unique' => 1));
-
-/* MongoDB will one of the conflicting documents and allow the unique index to
- * be created.
- */
-$collection->createIndex(array('username' => 1), array('unique' => 1, 'dropDups' => 1));
-
-/* We now have a unique index and subsequent inserts with the same username will
- * fail.
- */
-$collection->insert(array('username' => 'joeschmoe'));
-
-?>
-]]>
-
-
-
-
-
- &reftitle.seealso;
-
- MongoCollection::deleteIndex
- MongoCollection::deleteIndexes
-
- The MongoDB
- index and
- index type
- documentation.
-
-
-
-
-
-
diff --git a/reference/mongo/mongocollection/deleteindex.xml b/reference/mongo/mongocollection/deleteindex.xml
deleted file mode 100644
index 3495edd188..0000000000
--- a/reference/mongo/mongocollection/deleteindex.xml
+++ /dev/null
@@ -1,170 +0,0 @@
-
-
-
-
-
- MongoCollection::deleteIndex
- Deletes an index from this collection
-
-
-
- &reftitle.description;
-
- publicarrayMongoCollection::deleteIndex
- stringarraykeys
-
-
- This method is identical to:
-
-
-toIndexString($keys);
-
- return $this->db->command(array(
- "deleteIndexes" => $this->getName(),
- "index" => $indexName,
- ));
-}
-
-?>
-]]>
-
-
- Each index is given a unique name when it is created. This is often generated
- by the driver based on the index key(s) and order/type, but custom names may
- also be specified with MongoCollection::createIndex's
- "name" option).
-
-
- Unfortunately, MongoCollection::deleteIndex cannot
- delete custom-named indexes due to a backwards compatibility issue. When a
- string argument is provided, it is assumed to be the single field name in an
- ascending index (e.g. the name "x_1" would be used for the
- argument "x"). If an array or object is provided, an index
- name is generated just as if that argument was passed to
- MongoCollection::createIndex.
-
-
- In order to delete a custom-named index with the PHP driver, the
- deleteIndexes database command must be used. For instance,
- an index named "myIndex" could be deleted with the PHP driver by running:
-
-
-command(array(
- "deleteIndexes" => $collection->getName(),
- "index" => "myIndex",
-));
-
-?>
-]]>
-
-
- To determine the name of an index with the PHP driver, you can query the
- system.indexes collection of a database and look for the
- "name" field of each result. The "ns"
- field will indicate the collection to which each index belongs.
-
-
-
-
- &reftitle.parameters;
-
-
-
-
- keys
-
-
-
- An array specifying the index's fields as its keys. For each field, the
- value is either the index direction or
- index type.
- If specifying direction, specify 1 for ascending or
- -1 for descending.
-
-
- If a string is provided, it is assumed to be the single field name in an
- ascending index.
-
-
-
-
-
-
-
-
- &reftitle.returnvalues;
-
- Returns the database response.
-
-
-
-
- &reftitle.examples;
-
- MongoCollection::deleteIndex example
-
- This example passes the function string and array parameters.
-
-
-example->indices;
-
-// create and remove a simple index
-$c->createIndex(array("i"=>1));
-$c->deleteIndex("i");
-
-// create and remove a multi-key index
-$c->ensureIndex(array("j" => 1, "k" => 1));
-$c->deleteIndex(array("j" => 1, "k" => 1));
-
-?>
-]]>
-
-
-
-
-
- &reftitle.seealso;
-
- MongoCollection::createIndex
- MongoCollection::deleteIndexes
- MongoCollection::toIndexString
-
- The MongoDB
- index and
- index type
- documentation.
-
-
-
-
-
-
diff --git a/reference/mongo/mongocollection/deleteindexes.xml b/reference/mongo/mongocollection/deleteindexes.xml
deleted file mode 100644
index 37c4c7b14e..0000000000
--- a/reference/mongo/mongocollection/deleteindexes.xml
+++ /dev/null
@@ -1,87 +0,0 @@
-
-
-
-
-
- MongoCollection::deleteIndexes
- Delete all indices for this collection
-
-
-
- &reftitle.description;
-
- publicarrayMongoCollection::deleteIndexes
-
-
-
-
-
- &reftitle.parameters;
- &no.function.parameters;
-
-
-
- &reftitle.returnvalues;
-
- Returns the database response.
-
-
-
-
- &reftitle.examples;
-
- MongoCollection::deleteIndexes example
- This example demonstrates how to delete all indexes from a collection and the response to expect.
-
-my_db->articles;
-$response = $collection->deleteIndexes();
-print_r($response);
-
-?>
-]]>
-
- &example.outputs.similar;
-
- 1
- [msg] => all indexes deleted for collection
- [ok] => 1
-)
-]]>
-
-
-
-
-
- &reftitle.seealso;
-
- MongoCollection::createIndex
- MongoCollection::deleteIndex
-
-
-
-
-
diff --git a/reference/mongo/mongocollection/distinct.xml b/reference/mongo/mongocollection/distinct.xml
deleted file mode 100644
index 4a1b70c140..0000000000
--- a/reference/mongo/mongocollection/distinct.xml
+++ /dev/null
@@ -1,156 +0,0 @@
-
-
-
-
-
- MongoCollection::distinct
- Retrieve a list of distinct values for the given key across a collection
-
-
-
- &reftitle.description;
-
- publicarrayfalseMongoCollection::distinct
- stringkey
- arrayquery
-
-
- The distinct command returns a list of distinct values for the given key
- across a collection.
-
-
-
-
- &reftitle.parameters;
-
-
- key
-
-
- The key to use.
-
-
-
-
- query
-
-
- An optional query parameters
-
-
-
-
-
-
-
- &reftitle.returnvalues;
-
- Returns an array of distinct values, &return.falseforfailure;
-
-
-
-
- &reftitle.examples;
-
- MongoCollection::distinct example
-
-selectDB("test");
-$db->dropCollection("distinct");
-$c = $db->distinct;
-
-$c->insert(array("stuff" => "bar", "zip-code" => 10010));
-$c->insert(array("stuff" => "foo", "zip-code" => 10010));
-$c->insert(array("stuff" => "bar", "zip-code" => 99701), array("w" => 1));
-
-$retval = $c->distinct("zip-code");
-var_dump($retval);
-
-$retval = $c->distinct("zip-code", array("stuff" => "foo"));
-var_dump($retval);
-
-$retval = $c->distinct("zip-code", array("stuff" => "bar"));
-var_dump($retval);
-
-?>
-]]>
-
- &example.outputs;
-
-
- int(10010)
- [1]=>
- int(99701)
-}
-array(1) {
- [0]=>
- int(10010)
-}
-array(2) {
- [0]=>
- int(10010)
- [1]=>
- int(99701)
-}
-]]>
-
-
-
- MongoCollection::distinct example on a embedded document
-
-insert(array("user" => array("points" => 25)));
-$c->insert(array("user" => array("points" => 31)));
-$c->insert(array("user" => array("points" => 25)));
-
-$retval = $c->distinct("user.points");
-var_dump($retval);
-
-$retval = $c->distinct("user.nonexisting");
-var_dump($retval);
-?>
-]]>
-
- &example.outputs;
-
-
- int(25)
- [1]=>
- int(31)
-}
-array(0) {
-}
-]]>
-
-
-
-
-
-
-
diff --git a/reference/mongo/mongocollection/drop.xml b/reference/mongo/mongocollection/drop.xml
deleted file mode 100644
index c7a20890f0..0000000000
--- a/reference/mongo/mongocollection/drop.xml
+++ /dev/null
@@ -1,82 +0,0 @@
-
-
-
-
-
- MongoCollection::drop
- Drops this collection
-
-
-
- &reftitle.description;
-
- publicarrayMongoCollection::drop
-
-
-
- Drops this collection and deletes its indices.
-
-
-
-
- &reftitle.parameters;
- &no.function.parameters;
-
-
-
- &reftitle.returnvalues;
-
- Returns the database response.
-
-
-
-
- &reftitle.examples;
-
- MongoCollection::drop example
- This example demonstrates how to drop a collection and the response to expect.
-
-my_db->articles;
-$response = $collection->drop();
-print_r($response);
-
-?>
-]]>
-
- &example.outputs.similar;
-
- 1
- [msg] => all indexes deleted for collection
- [ns] => my_db.articles
- [ok] => 1
-)
-]]>
-
-
-
-
-
diff --git a/reference/mongo/mongocollection/ensureindex.xml b/reference/mongo/mongocollection/ensureindex.xml
deleted file mode 100644
index 700df2d907..0000000000
--- a/reference/mongo/mongocollection/ensureindex.xml
+++ /dev/null
@@ -1,347 +0,0 @@
-
-
-
-
-
- MongoCollection::ensureIndex
-
- Creates an index on the specified field(s) if it does not already exist
-
-
-
-
- &reftitle.description;
-
- publicboolMongoCollection::ensureIndex
- stringarraykey|keys
- arrayoptionsarray()
-
-
-
- This method is deprecated since version 1.5.0. Please use
- MongoCollection::createIndex instead.
-
-
-
- Creates an index on the specified field(s) if it does not already exist.
- Fields may be indexed with a direction (e.g. ascending or descending) or a
- special type (e.g. text, geospatial, hashed).
-
-
-
- This method will use the
- createIndexes
- database command when communicating with MongoDB 2.6+. For previous database
- versions, the method will perform an insert operation on the
- special system.indexes collection.
-
-
-
-
-
- &reftitle.parameters;
-
-
-
-
- keys
-
-
-
- An array specifying the index's fields as its keys. For each field, the
- value is either the index direction or
- index type.
- If specifying direction, specify 1 for ascending or
- -1 for descending.
-
-
-
-
-
- options
-
-
-
- An array of options for the index creation. Currently available options
- include:
-
- &mongo.index.parameters.unique;
- &mongo.index.parameters.sparse;
- &mongo.index.parameters.expireafterseconds;
- &mongo.index.parameters.name;
- &mongo.index.parameters.background;
- &mongo.writes.parameters.sockettimeoutms;
-
-
-
- The following option may be used with MongoDB 2.6+:
-
- &mongo.command.parameters.maxtimems;
-
-
-
- The following options may be used with MongoDB versions before 2.8:
-
- &mongo.index.parameters.dropdups;
-
-
-
- The following options may be used with MongoDB versions before 2.6:
-
- &mongo.writes.parameters.writeconcern;
- &mongo.writes.parameters.writeconcerntimeoutms;
-
-
-
- The following options are deprecated and should no longer be used:
-
- &mongo.writes.parameters.safe;
- &mongo.writes.parameters.timeout;
- &mongo.writes.parameters.writeconcerntimeout;
-
-
-
-
-
-
-
-
-
- &reftitle.returnvalues;
-
- Returns an array containing the status of the index creation. The array
- contains whether the operation succeeded ("ok"), the
- number of indexes before and after the operation
- ("numIndexesBefore" and
- "numIndexesAfter"), and whether the collection that the
- index belongs to has been created
- ("createdCollectionAutomatically"). If the index already
- existed and did not need to be created, a "note" field may
- be present in lieu of "numIndexesAfter".
-
-
- With MongoDB 2.4 and earlier, a status document is only returned if the
- write concern is at least
- 1. Otherwise, &true; is returned. The fields in the status
- document are different, except for the "ok" field, which
- signals whether the index creation was successful. Additional fields are
- described in the documentation for
- MongoCollection::insert.
-
-
-
-
- &reftitle.changelog;
-
-
-
-
-
- &Version;
- &Description;
-
-
-
-
- PECL mongo 1.5.0
-
-
- Renamed the "wtimeout" option to
- "wTimeoutMS". Emits
- E_DEPRECATED when "wtimeout" is
- used.
-
-
- Renamed the "timeout" option to
- "socketTimeoutMS". Emits
- E_DEPRECATED when "timeout" is
- used.
-
-
- Emits E_DEPRECATED when "safe"
- is used.
-
-
-
-
- PECL mongo 1.3.4
- Added "wtimeout" option.
-
-
- PECL mongo 1.3.0
-
- Added "w" option.
-
- The options parameter no longer accepts a
- boolean to signify a unique index. Instead, this now has to be done
- with array('unique' => true).
-
-
-
-
- PECL mongo 1.2.11
-
- Emits E_DEPRECATED when
- options is scalar.
-
-
-
- PECL mongo 1.2.0
- Added "timeout" option.
-
-
- PECL mongo 1.0.11
-
-
- The "safe" option will trigger a primary failover,
- if necessary.
-
-
- MongoException will be thrown if the index name
- (either generated or set) is longer than 128 bytes.
-
-
-
-
- PECL mongo 1.0.5
-
- Added the "name" option to override index name
- creation.
-
-
-
- PECL mongo 1.0.2
-
- Changed options parameter from boolean to array.
- Pre-1.0.2, the second parameter was an optional boolean value specifying
- a unique index.
-
-
-
-
-
-
-
-
-
- &reftitle.errors;
-
- Throws MongoException if the index name is longer
- than 128 bytes, or if the index specification is not an array.
-
-
- Throws MongoDuplicateKeyException if the server could not
- create the unique index due to conflicting documents.
-
-
- Throws MongoResultException if the server could not
- create the index due to an error.
-
- &mongo.errors.exceptions.writeconcern;
-
-
-
- &reftitle.examples;
-
- MongoCollection::ensureIndex example
-
-ensureIndex(array('x' => 1));
-
-// create a unique index on 'y'
-$c->ensureIndex(array('y' => 1), array('unique' => true));
-
-// create a compound index on 'za' ascending and 'zb' descending
-$c->ensureIndex(array('za' => 1, 'zb' => -1));
-
-?>
-]]>
-
-
-
- Geospatial Indexing
-
- Mongo supports geospatial indexes, which allow you to search for documents
- near a given location or within a shape. The following example creates a
- geospatial index on the "loc" field:
-
-
-ensureIndex(array('loc' => '2dsphere'));
-
-?>
-]]>
-
-
-
- Drop duplicates example
-
-insert(array('username' => 'joeschmoe'));
-$collection->insert(array('username' => 'joeschmoe'));
-
-/* Index creation fails, since you cannot create a unique index on a field when
- * duplicates exist.
- */
-$collection->ensureIndex(array('username' => 1), array('unique' => 1));
-
-/* MongoDB will one of the conflicting documents and allow the unique index to
- * be created.
- */
-$collection->ensureIndex(array('username' => 1), array('unique' => 1, 'dropDups' => 1));
-
-/* We now have a unique index and subsequent inserts with the same username will
- * fail.
- */
-$collection->insert(array('username' => 'joeschmoe'));
-
-?>
-]]>
-
-
-
-
-
- &reftitle.seealso;
-
- MongoCollection::createIndex
- MongoCollection::deleteIndex
- MongoCollection::deleteIndexes
-
- The MongoDB
- index and
- index type
- documentation.
-
-
-
-
-
-
diff --git a/reference/mongo/mongocollection/find.xml b/reference/mongo/mongocollection/find.xml
deleted file mode 100644
index 0c8f142707..0000000000
--- a/reference/mongo/mongocollection/find.xml
+++ /dev/null
@@ -1,392 +0,0 @@
-
-
-
-
-
- MongoCollection::find
- Queries this collection, returning a MongoCursor
- for the result set
-
-
-
- &reftitle.description;
-
- publicMongoCursorMongoCollection::find
- arrayqueryarray()
- arrayfieldsarray()
-
-
-
-
- &reftitle.parameters;
-
-
-
-
- query
-
-
-
- The fields for which to search. MongoDB's query language is quite
- extensive. The PHP driver will in almost all cases pass the query
- straight through to the server, so reading the MongoDB core docs on
- find is a good idea.
-
-
-
- Please make sure that for all special query operators (starting with
- $) you use single quotes so that PHP doesn't try to
- replace "$exists" with the value of the variable
- $exists.
-
-
-
-
-
-
- fields
-
-
-
- Fields of the results to return. The array is in the format
- array('fieldname' => true, 'fieldname2' => true).
- The _id field is always returned.
-
-
-
-
-
-
-
-
- &reftitle.returnvalues;
-
- Returns a cursor for the search results.
-
-
-
-
- &reftitle.examples;
-
- MongoCollection::find example
- This example demonstrates basic search options.
-
-selectDB('test');
-$collection = new MongoCollection($db, 'produce');
-
-// search for fruits
-$fruitQuery = array('Type' => 'Fruit');
-
-$cursor = $collection->find($fruitQuery);
-foreach ($cursor as $doc) {
- var_dump($doc);
-}
-
-// search for produce that is sweet. Taste is a child of Details.
-$sweetQuery = array('Details.Taste' => 'Sweet');
-echo "Sweet\n";
-$cursor = $collection->find($sweetQuery);
-foreach ($cursor as $doc) {
- var_dump($doc);
-}
-
-?>
-]]>
-
- &example.outputs;
-
-
- object(MongoId)#7 (1) {
- ["$id"]=>
- string(24) "50a87dd084f045a19b220dd6"
- }
- ["Name"]=>
- string(5) "Apple"
- ["Type"]=>
- string(5) "Fruit"
- ["Details"]=>
- array(2) {
- ["Taste"]=>
- string(5) "Sweet"
- ["Colour"]=>
- string(3) "Red"
- }
-}
-array(4) {
- ["_id"]=>
- object(MongoId)#8 (1) {
- ["$id"]=>
- string(24) "50a87de084f045a19b220dd7"
- }
- ["Name"]=>
- string(5) "Lemon"
- ["Type"]=>
- string(5) "Fruit"
- ["Details"]=>
- array(2) {
- ["Taste"]=>
- string(4) "Sour"
- ["Colour"]=>
- string(5) "Green"
- }
-}
-
-Sweet:
-array(4) {
- ["_id"]=>
- object(MongoId)#7 (1) {
- ["$id"]=>
- string(24) "50a87dd084f045a19b220dd6"
- }
- ["Name"]=>
- string(5) "Apple"
- ["Type"]=>
- string(5) "Fruit"
- ["Details"]=>
- array(2) {
- ["Taste"]=>
- string(5) "Sweet"
- ["Colour"]=>
- string(3) "Red"
- }
-}
-]]>
-
-
- See MongoCursor for more information how to work with cursors.
-
-
-
- MongoCollection::find example
- This example demonstrates how to search for a range.
-
-selectDB('test');
-$collection = new MongoCollection($db, 'phpmanual');
-
-// search for documents where 5 < x < 20
-$rangeQuery = array('x' => array( '$gt' => 5, '$lt' => 20 ));
-
-$cursor = $collection->find($rangeQuery);
-foreach ($cursor as $doc) {
- var_dump($doc);
-}
-
-?>
-]]>
-
- &example.outputs;
-
-
- object(MongoId)#10 (1) {
- ["$id"]=>
- string(24) "4ebc3e3710b89f2349000000"
- }
- ["x"]=>
- int(12)
-}
-array(2) {
- ["_id"]=>
- object(MongoId)#11 (1) {
- ["$id"]=>
- string(24) "4ebc3e3710b89f2349000001"
- }
- ["x"]=>
- int(12)
-}
-]]>
-
-
- See MongoCursor for more information how to work with cursors.
-
-
-
- MongoCollection::find example using $where
- This example demonstrates how to search a collection using javascript code to reduce the resultset.
-
-selectDB('test');
-$collection = new MongoCollection($db, 'phpmanual');
-
-$js = "function() {
- return this.name == 'Joe' || this.age == 50;
-}";
-$cursor = $collection->find(array('$where' => $js));
-foreach ($cursor as $doc) {
- var_dump($doc);
-}
-
-?>
-]]>
-
- &example.outputs;
-
-
- object(MongoId)#7 (1) {
- ["$id"]=>
- string(24) "4ebc3e3710b89f2349000002"
- }
- ["name"]=>
- string(3) "Joe"
- ["age"]=>
- int(20)
-}
-]]>
-
-
-
- MongoCollection::find example using $in
- This example demonstrates how to search a collection using the $in operator.
-
-selectDB('test');
-$collection = new MongoCollection($db, 'phpmanual');
-
-$cursor = $collection->find(array(
- 'name' => array('$in' => array('Joe', 'Wendy'))
-));
-
-?>
-]]>
-
- &example.outputs;
-
-
- object(MongoId)#7 (1) {
- ["$id"]=>
- string(24) "4ebc3e3710b89f2349000002"
- }
- ["name"]=>
- string(3) "Joe"
- ["age"]=>
- int(20)
-}
-]]>
-
-
-
-
- Getting results as an array
-
- This returns a MongoCursor. Often, when people are
- starting out, they are more comfortable using an array. To turn a cursor
- into an array, use the iterator_to_array function.
-
-
-selectDB('test');
-$collection = new MongoCollection($db, 'phpmanual');
-
-$cursor = $collection->find();
-$array = iterator_to_array($cursor);
-
-?>
-]]>
-
- &example.outputs;
-
-
- array(2) {
- ["_id"]=>
- object(MongoId)#6 (1) {
- ["$id"]=>
- string(24) "4ebc40af10b89f5149000000"
- }
- ["x"]=>
- int(12)
- }
- ["4ebc40af10b89f5149000001"]=>
- array(2) {
- ["_id"]=>
- object(MongoId)#11 (1) {
- ["$id"]=>
- string(24) "4ebc40af10b89f5149000001"
- }
- ["x"]=>
- int(12)
- }
- ["4ebc40af10b89f5149000002"]=>
- array(3) {
- ["_id"]=>
- object(MongoId)#12 (1) {
- ["$id"]=>
- string(24) "4ebc40af10b89f5149000002"
- }
- ["name"]=>
- string(3) "Joe"
- ["age"]=>
- int(20)
- }
-}
-]]>
-
-
- Using iterator_to_array forces the driver to load all of
- the results into memory, so do not do this for result sets that are larger
- than memory!
-
-
- Also, certain system collections do not have an _id
- field. If you are dealing with a collection that might have documents
- without _ids, pass &false; as the second argument to
- iterator_to_array (so that it will not try to use the
- non-existent _id values as keys).
-
-
-
-
-
- &reftitle.seealso;
-
- MongoCollection::findOne
- MongoCollection::insert
- MongoDB core docs on find.
-
-
-
-
-
diff --git a/reference/mongo/mongocollection/findandmodify.xml b/reference/mongo/mongocollection/findandmodify.xml
deleted file mode 100644
index f622d6fc28..0000000000
--- a/reference/mongo/mongocollection/findandmodify.xml
+++ /dev/null
@@ -1,288 +0,0 @@
-
-
-
-
-
- MongoCollection::findAndModify
- Update a document and return it
-
-
-
- &reftitle.description;
-
- publicarrayMongoCollection::findAndModify
- arrayquery
- arrayupdate
- arrayfields
- arrayoptions
-
-
- The findAndModify command atomically modifies and returns a single document.
- By default, the returned document does not include the modifications made on
- the update. To return the document with the modifications made on the
- update, use the new option.
-
-
-
-
-
- &reftitle.parameters;
-
-
- query
-
-
- The query criteria to search for.
-
-
-
-
- update
-
-
- The update criteria.
-
-
-
-
- fields
-
-
- Optionally only return these fields.
-
-
-
-
- options
-
-
- An array of options to apply, such as remove the match document from the
- DB and return it.
-
-
-
-
- Option
- &Description;
-
-
-
-
- sortarray
-
- Determines which document the operation will modify if the
- query selects multiple documents. findAndModify will modify the
- first document in the sort order specified by this argument.
-
-
-
- removebool
-
- Optional if update field exists. When &true;, removes the selected
- document. The default is &false;.
-
-
-
- updatearray
-
- Optional if remove field exists.
- Performs an update of the selected document.
-
-
-
- newbool
-
- Optional. When &true;, returns the modified document rather than the
- original. The findAndModify method ignores the new option for
- remove operations. The default is &false;.
-
-
-
- upsertbool
-
- Optional. Used in conjunction with the update field. When &true;, the
- findAndModify command creates a new document if the query returns
- no documents. The default is false. In MongoDB 2.2, the
- findAndModify command returns &null; when upsert is &true;.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- &reftitle.returnvalues;
-
- Returns the original document, or the modified document when
- new is set.
-
-
-
-
- &reftitle.errors;
-
- Throws MongoResultException on failure.
-
-
-
-
- &reftitle.examples;
-
- MongoCollection::findAndModify example
-
-selectDB("test")->jobs;
-
-$col->insert(array(
- "name" => "Next promo",
- "inprogress" => false,
- "priority" => 0,
- "tasks" => array( "select product", "add inventory", "do placement"),
-) );
-
-$col->insert(array(
- "name" => "Biz report",
- "inprogress" => false,
- "priority" => 1,
- "tasks" => array( "run sales report", "email report" )
-) );
-
-$col->insert(array(
- "name" => "Biz report",
- "inprogress" => false,
- "priority" => 2,
- "tasks" => array( "run marketing report", "email report" )
- ),
- array("w" => 1)
-);
-
-
-
-$retval = $col->findAndModify(
- array("inprogress" => false, "name" => "Biz report"),
- array('$set' => array('inprogress' => true, "started" => new MongoDate())),
- null,
- array(
- "sort" => array("priority" => -1),
- "new" => true,
- )
-);
-
-var_dump($retval);
-?>
-]]>
-
- &example.outputs.similar;
-
-
- object(MongoId)#7 (1) {
- ["$id"]=>
- string(24) "5091b5b244415e8cc3000002"
- }
- ["inprogress"]=>
- bool(true)
- ["name"]=>
- string(10) "Biz report"
- ["priority"]=>
- int(2)
- ["started"]=>
- object(MongoDate)#8 (2) {
- ["sec"]=>
- int(1351726514)
- ["usec"]=>
- int(925000)
- }
- ["tasks"]=>
- array(2) {
- [0]=>
- string(20) "run marketing report"
- [1]=>
- string(12) "email report"
- }
-}
-]]>
-
-
-
- MongoCollection::findAndModify error handling
-
-selectDB("test")->jobs;
-try {
- $retval = $col->findAndModify(
- array("inprogress" => false, "name" => "Next promo"),
- array('$pop' => array("tasks" => -1)),
- array("tasks" => array('$pop' => array("stuff"))),
- array("new" => true)
- );
-} catch(MongoResultException $e) {
- echo $e->getCode(), " : ", $e->getMessage(), "\n";
- var_dump($e->getDocument());
-}
-
-?>
-]]>
-
- &example.outputs.similar;
-
-
- string(46) "exception: Unsupported projection option: $pop"
- ["code"]=>
- int(13097)
- ["ok"]=>
- float(0)
-}
-]]>
-
-
-
-
-
- &reftitle.seealso;
-
- The MongoDB findAndModify command docs
-
-
-
-
-
-
-
diff --git a/reference/mongo/mongocollection/findone.xml b/reference/mongo/mongocollection/findone.xml
deleted file mode 100644
index a920b40932..0000000000
--- a/reference/mongo/mongocollection/findone.xml
+++ /dev/null
@@ -1,196 +0,0 @@
-
-
-
-
-
- MongoCollection::findOne
- Queries this collection, returning a single element
-
-
-
- &reftitle.description;
-
- publicarrayMongoCollection::findOne
- arrayqueryarray()
- arrayfieldsarray()
- arrayoptionsarray()
-
-
- As opposed to MongoCollection::find, this method
- will return only the first result from the result set,
- and not a MongoCursor that can be iterated over.
-
-
-
-
- &reftitle.parameters;
-
-
-
-
- query
-
-
-
- The fields for which to search. MongoDB's query language is quite
- extensive. The PHP driver will in almost all cases pass the query
- straight through to the server, so reading the MongoDB core docs on
- find is a good idea.
-
-
-
- Please make sure that for all special query operaters (starting with
- $) you use single quotes so that PHP doesn't try to
- replace "$exists" with the value of the variable
- $exists.
-
-
-
-
-
-
- fields
-
-
-
- Fields of the results to return. The array is in the format
- array('fieldname' => true, 'fieldname2' => true).
- The _id field is always returned.
-
-
-
-
-
- options
-
-
-
- This parameter is an associative array of the form
- array("name" => <value>, ...). Currently
- supported options are:
-
-
- &mongo.command.parameters.maxtimems;
-
-
-
-
-
-
-
-
- &reftitle.returnvalues;
-
- Returns record matching the search or &null;.
-
-
-
-
- &reftitle.errors;
-
- Throws MongoConnectionException if it cannot reach the
- database.
-
-
-
-
- &reftitle.changelog;
-
-
-
-
- &Version;
- &Description;
-
-
-
-
- PECL mongo 1.5.0
-
- Added optional options argument.
-
-
-
-
-
-
-
-
- &reftitle.examples;
-
- MongoCollection::findOne document by its id.
- This example demonstrates how to find a single document in a collection by its id.
-
-my_db->articles;
-
-$article = $articles->findOne(array('_id' => new MongoId('47cc67093475061e3d9536d2')));
-
-?>
-]]>
-
-
-
- MongoCollection::findOne document by some condition.
- This example demonstrates how to find a single document in a collection by some condition and limiting the returned fields.
-
-my_db->users;
-$user = $users->findOne(array('username' => 'jwage'), array('password'));
-print_r($user);
-
-?>
-]]>
-
- &example.outputs.similar;
-
- MongoId Object
- (
- )
-
- [password] => test
-)
-]]>
-
-
- Notice how even though the document does have a username field, we limited the results
- to only contain the password field.
-
-
-
-
-
- &reftitle.seealso;
-
- MongoCollection::find
- MongoCollection::insert
- MongoDB core docs on find.
-
-
-
-
diff --git a/reference/mongo/mongocollection/get.xml b/reference/mongo/mongocollection/get.xml
deleted file mode 100644
index 6c09efd26c..0000000000
--- a/reference/mongo/mongocollection/get.xml
+++ /dev/null
@@ -1,76 +0,0 @@
-
-
-
-
-
- MongoCollection::__get
- Gets a collection
-
-
- &reftitle.description;
-
- publicMongoCollectionMongoCollection::__get
- stringname
-
-
- A concise syntax for getting a collection with a dot-separated name. If a
- collection name contains strange characters, you may have to use
- MongoDB::selectCollection instead.
-
-selectDB("foo")->selectCollection("bar.baz");
-$collection = $mongo->foo->bar->baz;
-
-?>
-]]>
-
-
-
-
- &reftitle.parameters;
-
-
-
-
- name
-
-
-
- The next string in the collection name.
-
-
-
-
-
-
-
- &reftitle.returnvalues;
-
- Returns the collection.
-
-
-
-
diff --git a/reference/mongo/mongocollection/getdbref.xml b/reference/mongo/mongocollection/getdbref.xml
deleted file mode 100644
index 759d79f9ea..0000000000
--- a/reference/mongo/mongocollection/getdbref.xml
+++ /dev/null
@@ -1,113 +0,0 @@
-
-
-
-
-
- MongoCollection::getDBRef
- Fetches the document pointed to by a database reference
-
-
-
- &reftitle.description;
-
- publicarrayMongoCollection::getDBRef
- arrayref
-
-
-
-
- &reftitle.parameters;
-
-
-
-
- ref
-
-
-
- A database reference.
-
-
-
-
-
-
-
-
- &reftitle.returnvalues;
-
- Returns the database document pointed to by the reference.
-
-
-
-
- &reftitle.examples;
-
- MongoCollection::getDBRef example
-
-playlists;
-
-$myList = $playlists->findOne(array('username' => 'me'));
-
-// fetch each song in the playlist
-foreach ($myList['songlist'] as $songRef) {
- $song = $playlists->getDBRef($songRef);
- echo $song['title'] . "\n";
-}
-
-?>
-]]>
-
- &example.outputs.similar;
-
-
-
-
- In the above example each $songRef looks something like the following:
- songs
- [$id] => 49902cde5162504500b45c2c
- )
- ]]>
-
-
-
-
-
- &reftitle.seealso;
-
-
- MongoCollection::createDBRef
-
-
-
-
-
-
diff --git a/reference/mongo/mongocollection/getindexinfo.xml b/reference/mongo/mongocollection/getindexinfo.xml
deleted file mode 100644
index c7b4efeabb..0000000000
--- a/reference/mongo/mongocollection/getindexinfo.xml
+++ /dev/null
@@ -1,149 +0,0 @@
-
-
-
-
-
- MongoCollection::getIndexInfo
- Returns information about indexes on this collection
-
-
-
- &reftitle.description;
-
- publicarrayMongoCollection::getIndexInfo
-
-
-
-
-
- &reftitle.parameters;
- &no.function.parameters;
-
-
-
- &reftitle.returnvalues;
-
- This function returns an array in which each element describes an index.
- Elements will contain the values name for the name of
- the index, ns for the namespace (a combination of the
- database and collection name), and key for a list of all
- fields in the index and their ordering. Additional values may be present for
- special indexes, such as unique or
- sparse.
-
-
-
-
- &reftitle.examples;
-
- MongoCollection::getIndexInfo example
-
-selectCollection('test', 'venues');
-var_dump($c->getIndexInfo());
-
-?>
-]]>
-
- &example.outputs.similar;
-
-
- array(4) {
- ["v"]=>
- int(1)
- ["key"]=>
- array(1) {
- ["_id"]=>
- int(1)
- }
- ["name"]=>
- string(4) "_id_"
- ["ns"]=>
- string(11) "test.venues"
- }
- [1]=>
- array(4) {
- ["v"]=>
- int(1)
- ["key"]=>
- array(1) {
- ["name"]=>
- float(1)
- }
- ["name"]=>
- string(6) "name_1"
- ["ns"]=>
- string(11) "test.venues"
- }
- [2]=>
- array(4) {
- ["v"]=>
- int(1)
- ["key"]=>
- array(2) {
- ["type"]=>
- float(1)
- ["createdAt"]=>
- float(-1)
- }
- ["name"]=>
- string(19) "type_1_createdAt_-1"
- ["ns"]=>
- string(11) "test.venues"
- }
- [3]=>
- array(5) {
- ["v"]=>
- int(1)
- ["key"]=>
- array(1) {
- ["location"]=>
- string(8) "2dsphere"
- }
- ["name"]=>
- string(17) "location_2dsphere"
- ["ns"]=>
- string(11) "test.venues"
- ["2dsphereIndexVersion"]=>
- int(2)
- }
-}
-]]>
-
-
-
-
-
- &reftitle.seealso;
-
- MongoDB core docs on
- vanilla indexes and
- geospatial indexes.
-
-
-
-
-
diff --git a/reference/mongo/mongocollection/getname.xml b/reference/mongo/mongocollection/getname.xml
deleted file mode 100644
index cce2c50aaa..0000000000
--- a/reference/mongo/mongocollection/getname.xml
+++ /dev/null
@@ -1,77 +0,0 @@
-
-
-
-
-
- MongoCollection::getName
- Returns this collection's name
-
-
- &reftitle.description;
-
- publicstringMongoCollection::getName
-
-
-
-
-
- &reftitle.parameters;
- &no.function.parameters;
-
-
-
- &reftitle.returnvalues;
-
- Returns the name of this collection.
-
-
-
- &reftitle.examples;
-
-
- MongoCollection::getName example
-
-foo->bar->baz;
-
-echo "Working with collection " . $c->getName() . ".\n";
-
-// the full namespace is given by the MongoCollection::__toString() method
-echo "Working in namespace $c.\n";
-
-?>
-]]>
-
- &example.outputs.similar;
-
-
-
-
-
-
-
-
diff --git a/reference/mongo/mongocollection/getreadpreference.xml b/reference/mongo/mongocollection/getreadpreference.xml
deleted file mode 100644
index 9e7a5ebd56..0000000000
--- a/reference/mongo/mongocollection/getreadpreference.xml
+++ /dev/null
@@ -1,135 +0,0 @@
-
-
-
-
-
- MongoCollection::getReadPreference
- Get the read preference for this collection
-
-
-
- &reftitle.description;
-
- publicarrayMongoCollection::getReadPreference
-
-
-
-
-
- &reftitle.parameters;
- &no.function.parameters;
-
-
-
- &reftitle.returnvalues;
- &mongo.getreadpreference.returnvalues;
-
-
-
- &reftitle.changelog;
-
-
-
-
-
- &Version;
- &Description;
-
-
-
-
- PECL mongo 1.3.3
-
- The return value has changed to be consistent with
- MongoCollection::setReadPreference. The
- type value was changed from a number to a string,
- type_string was removed, and
- tagsets now expresses tags as key/value pairs instead
- of colon-delimited strings.
-
-
-
-
-
-
-
-
-
- &reftitle.examples;
-
- MongoCollection::getReadPreference return value example
-
-test->users;
-$c->setReadPreference(MongoClient::RP_SECONDARY, array(
- array('dc' => 'east', 'use' => 'reporting'),
- array('dc' => 'west'),
- array(),
-));
-var_dump($c->getReadPreference());
-?>
-]]>
-
- &example.outputs;
-
-
- string(9) "secondary"
- ["tagsets"]=>
- array(3) {
- [0]=>
- array(2) {
- ["dc"]=>
- string(4) "east"
- ["use"]=>
- string(9) "reporting"
- }
- [1]=>
- array(1) {
- ["dc"]=>
- string(7) "west"
- }
- [2]=>
- array(0) {
- }
- }
-}
-]]>
-
-
-
-
-
- &reftitle.seealso;
-
- The read preferences documentation.
- MongoCollection::setReadPreference
-
-
-
-
-
-
diff --git a/reference/mongo/mongocollection/getslaveokay.xml b/reference/mongo/mongocollection/getslaveokay.xml
deleted file mode 100644
index 8144cc4511..0000000000
--- a/reference/mongo/mongocollection/getslaveokay.xml
+++ /dev/null
@@ -1,84 +0,0 @@
-
-
-
-
-
- MongoCollection::getSlaveOkay
- Get slaveOkay setting for this collection
-
-
-
- &reftitle.description;
-
- publicboolMongoCollection::getSlaveOkay
-
-
-
-
- See the query section of this manual for
- information on distributing reads to secondaries.
-
-
-
-
- &reftitle.parameters;
- &no.function.parameters;
-
-
-
- &reftitle.returnvalues;
-
- Returns the value of slaveOkay for this instance.
-
-
-
-
- &reftitle.changelog;
-
-
-
-
-
- &Version;
- &Description;
-
-
-
-
- PECL mongo 1.2.11
- Emits E_DEPRECATED when used.
-
-
-
-
-
-
-
-
- &reftitle.seealso;
-
-
- MongoCollection::getReadPreference
-
-
-
-
-
diff --git a/reference/mongo/mongocollection/getwriteconcern.xml b/reference/mongo/mongocollection/getwriteconcern.xml
deleted file mode 100644
index 12b6b5b16a..0000000000
--- a/reference/mongo/mongocollection/getwriteconcern.xml
+++ /dev/null
@@ -1,94 +0,0 @@
-
-
-
-
-
- MongoCollection::getWriteConcern
- Get the write concern for this collection
-
-
-
- &reftitle.description;
-
- publicarrayMongoCollection::getWriteConcern
-
-
-
-
-
- &reftitle.parameters;
- &no.function.parameters;
-
-
-
- &reftitle.returnvalues;
- &mongo.getwriteconcern.returnvalues;
-
-
-
- &reftitle.examples;
-
- MongoCollection::getWriteConcern return value example
-
- 500));
-$coll = $mc->selectCollection('test', 'foo');
-var_dump($coll->getWriteConcern());
-
-$coll->setWriteConcern(1, 1000);
-var_dump($coll->getWriteConcern());
-?>
-]]>
-
- &example.outputs;
-
-
- int(1)
- ["wtimeout"]=>
- int(500)
-}
-array(2) {
- ["w"]=>
- int(1)
- ["wtimeout"]=>
- int(1000)
-}
-]]>
-
-
-
-
-
- &reftitle.seealso;
-
- The write concern documentation.
- MongoCollection::setWriteConcern
-
-
-
-
-
-
diff --git a/reference/mongo/mongocollection/group.xml b/reference/mongo/mongocollection/group.xml
deleted file mode 100644
index 99dd1238bf..0000000000
--- a/reference/mongo/mongocollection/group.xml
+++ /dev/null
@@ -1,274 +0,0 @@
-
-
-
-
-
- MongoCollection::group
- Performs an operation similar to SQL's GROUP BY command
-
-
-
- &reftitle.description;
-
- publicarrayMongoCollection::group
- mixedkeys
- arrayinitial
- MongoCodereduce
- arrayoptionsarray()
-
-
-
-
- &reftitle.parameters;
-
-
-
-
- keys
-
-
-
- Fields to group by. If an array or non-code object is passed, it will be
- the key used to group results.
-
- 1.0.4+: If keys is an instance of
- MongoCode, keys will be treated as
- a function that returns the key to group by (see the "Passing a
- keys function" example below).
-
-
-
-
-
- initial
-
-
-
- Initial value of the aggregation counter object.
-
-
-
-
-
- reduce
-
-
-
- A function that takes two arguments (the current document and the
- aggregation to this point) and does the aggregation.
-
-
-
-
-
- options
-
-
-
- Optional parameters to the group command. Valid options include:
-
-
-
-
- "condition"
-
-
- Criteria for including a document in the aggregation.
-
-
-
-
- "finalize"
-
-
- Function called once per unique key that takes the final output of the
- reduce function.
-
-
- &mongo.command.parameters.maxtimems;
-
-
-
-
-
-
-
-
- &reftitle.returnvalues;
-
- Returns an array containing the result.
-
-
-
-
- &reftitle.changelog;
-
-
-
-
-
- &Version;
- &Description;
-
-
-
-
- PECL mongo 1.5.0
- Added "maxTimeMS" option.
-
-
- PECL mongo 1.2.11
-
- Emits E_DEPRECATED when
- options is scalar.
-
-
-
-
-
-
-
-
-
- &reftitle.examples;
-
- MongoCollection::group example
-
- This groups documents by category and creates a list of names within that
- category.
-
-
-insert(array("category" => "fruit", "name" => "apple"));
-$collection->insert(array("category" => "fruit", "name" => "peach"));
-$collection->insert(array("category" => "fruit", "name" => "banana"));
-$collection->insert(array("category" => "veggie", "name" => "corn"));
-$collection->insert(array("category" => "veggie", "name" => "broccoli"));
-
-$keys = array("category" => 1);
-
-$initial = array("items" => array());
-
-$reduce = "function (obj, prev) { prev.items.push(obj.name); }";
-
-$g = $collection->group($keys, $initial, $reduce);
-
-echo json_encode($g['retval']);
-
-?>
-]]>
-
- &example.outputs.similar;
-
-
-
-
-
-
- MongoCollection::group example
-
- This example doesn't use any key, so every document will be its own group.
- It also uses a condition: only documents that match this condition will be
- processed by the grouping function.
-
-
-save(array("a" => 2));
-$collection->save(array("b" => 5));
-$collection->save(array("a" => 1));
-
-// use all fields
-$keys = array();
-
-// set intial values
-$initial = array("count" => 0);
-
-// JavaScript function to perform
-$reduce = "function (obj, prev) { prev.count++; }";
-
-// only use documents where the "a" field is greater than 1
-$condition = array('condition' => array("a" => array( '$gt' => 1)));
-
-$g = $collection->group($keys, $initial, $reduce, $condition);
-
-var_dump($g);
-
-?>
-]]>
-
- &example.outputs.similar;
-
-
- array(1) {
- [0]=>
- array(1) {
- ["count"]=>
- float(1)
- }
- }
- ["count"]=>
- float(1)
- ["keys"]=>
- int(1)
- ["ok"]=>
- float(1)
-}
-]]>
-
-
-
-
- Passing a keys function
-
- If you want to group by something other than a field name, you can pass
- a function as the first parameter of
- MongoCollection::group and it will be run against each
- document. The return value of the function will be used as its grouping
- value.
-
-
- This example demonstrates grouping by the num field modulo 4.
-
-
-
-group(new MongoCode('function(doc) { return {mod : doc.num % 4}; }'),
- array("count" => 0),
- new MongoCode('function(current, total) { total.count++; }'));
-
-?>
-]]>
-
-
-
-
-
-
diff --git a/reference/mongo/mongocollection/insert.xml b/reference/mongo/mongocollection/insert.xml
deleted file mode 100644
index 48ca6495a1..0000000000
--- a/reference/mongo/mongocollection/insert.xml
+++ /dev/null
@@ -1,453 +0,0 @@
-
-
-
-
-
- MongoCollection::insert
- Inserts a document into the collection
-
-
-
- &reftitle.description;
-
- publicboolarrayMongoCollection::insert
- arrayobjectdocument
- arrayoptionsarray()
-
-
- All strings sent to the database must be UTF-8. If a string is not UTF-8, a
- MongoException will be thrown. To insert
- (or query for) a non-UTF-8 string, use MongoBinData.
-
-
-
-
- &reftitle.parameters;
-
-
-
-
- document
-
-
-
- An array or object. If an object is used, it may not have protected or
- private properties.
-
-
-
- If the parameter does not have an _id key or
- property, a new MongoId instance will be created
- and assigned to it. This special behavior does not mean that the
- parameter is passed by reference.
-
-
-
-
-
-
- options
-
-
-
- An array of options for the insert operation. Currently available options
- include:
-
- &mongo.writes.parameters.fsync;
- &mongo.writes.parameters.journal;
- &mongo.writes.parameters.sockettimeoutms;
- &mongo.writes.parameters.writeconcern;
- &mongo.writes.parameters.writeconcerntimeoutms;
-
-
-
- The following options are deprecated and should no longer be used:
-
- &mongo.writes.parameters.safe;
- &mongo.writes.parameters.timeout;
- &mongo.writes.parameters.writeconcerntimeout;
-
-
-
-
-
-
-
-
-
- &reftitle.returnvalues;
-
- Returns an array containing the status of the insertion if the
- "w" option is set. Otherwise, returns &true; if the
- inserted array is not empty (a MongoException will be
- thrown if the inserted array is empty).
-
-
- If an array is returned, the following keys may be present:
-
-
-
- ok
-
-
-
- This should almost always be 1 (unless last_error itself failed).
-
-
-
-
-
- err
-
-
-
- If this field is non-null, an error occurred on the previous operation.
- If this field is set, it will be a string describing the error that
- occurred.
-
-
-
-
-
- code
-
-
-
- If a database error occurred, the relevant error code will be passed
- back to the client.
-
-
-
-
-
- errmsg
-
-
-
- This field is set if something goes wrong with a database command. It
- is coupled with ok being 0. For example, if
- w is set and times out, errmsg will be set to "timed
- out waiting for slaves" and ok will be 0. If this
- field is set, it will be a string describing the error that occurred.
-
-
-
-
-
- n
-
-
-
- If the last operation was an update, upsert, or a remove, the number
- of documents affected will be returned. For insert operations, this value
- is always 0.
-
-
-
-
-
- wtimeout
-
-
-
- If the previous option timed out waiting for replication.
-
-
-
-
-
- waited
-
-
-
- How long the operation waited before timing out.
-
-
-
-
-
- wtime
-
-
-
- If w was set and the operation succeeded, how long it took to
- replicate to w servers.
-
-
-
-
-
- upserted
-
-
-
- If an upsert occurred, this field will contain the new record's
- _id field. For upserts, either this field or
- updatedExisting will be present (unless an error
- occurred).
-
-
-
-
-
- updatedExisting
-
-
-
- If an upsert updated an existing element, this field will be true. For
- upserts, either this field or upserted will be present (unless an error
- occurred).
-
-
-
-
-
-
-
-
- &reftitle.errors;
-
- Throws MongoException if the inserted document is
- empty or if it contains zero-length keys. Attempting to insert an object with
- protected and private properties will cause a zero-length key error.
-
- &mongo.errors.exceptions.writeconcern;
-
-
-
- &reftitle.changelog;
-
-
-
-
-
- &Version;
- &Description;
-
-
-
-
- PECL mongo 1.5.0
-
-
- Added the "wTimeoutMS" option, which replaces
- "wtimeout". Emits E_DEPRECATED
- when "wtimeout" is used.
-
-
- Added the "socketTimeoutMS" option, which replaces
- "timeout". Emits E_DEPRECATED
- when "timeout" is used.
-
-
- Emits E_DEPRECATED when "safe"
- is used.
-
-
-
-
- PECL mongo 1.3.4
- Added "wtimeout" option.
-
-
- PECL mongo 1.3.0
-
- Added "w" option.
-
- The options parameter no longer accepts a
- boolean to signify an acknowledged write. Instead, this now has to be
- done with array('w' => 1) (the default behaviour of
- MongoClient).
-
-
-
-
- PECL mongo 1.2.0
- Added "timeout" option.
-
-
- PECL mongo 1.0.11
-
- Disconnects on "not master" errors if "safe" is set.
-
-
-
- PECL mongo 1.0.9
-
-
- Added ability to pass integers to the "safe" option,
- which previously only accepted booleans.
-
-
- Added "fsync" option.
-
-
- The return type was changed to be an array containing error information
- if the "safe" option is used. Otherwise, a boolean
- is returned as before.
-
-
-
-
- PECL mongo 1.0.2
-
- Changed second parameter to be an array of options. Pre-1.0.2, the
- second parameter was a boolean indicating the "safe"
- option.
-
-
-
- PECL mongo 1.0.1
-
- Throw a MongoCursorException if the
- "safe" option is set and the insert fails.
-
-
-
-
-
-
-
-
-
- &reftitle.examples;
-
- MongoCollection::insert_id example
-
- An _id field will be added to the inserted document if
- not already present. Depending on how the parameter is passed, a generated
- _id may or may not be available to calling code.
-
-
-selectCollection('test', 'phpmanual');
-
-// If an array literal is used, there is no way to access the generated _id
-$collection->insert(array('x' => 1));
-
-// The _id is available on an array passed by value
-$a = array('x' => 2);
-$collection->insert($a);
-var_dump($a);
-
-// The _id is not available on an array passed by reference
-$b = array('x' => 3);
-$ref = &$b;
-$collection->insert($ref);
-var_dump($ref);
-
-// The _id is available if a wrapping function does not trigger copy-on-write
-function insert_no_cow($collection, $document)
-{
- $collection->insert($document);
-}
-
-$c = array('x' => 4);
-insert_no_cow($collection, $c);
-var_dump($c);
-
-// The _id is not available if a wrapping function triggers copy-on-write
-function insert_cow($collection, $document)
-{
- $document['y'] = 1;
- $collection->insert($document);
-}
-
-$d = array('x' => 5);
-insert_cow($collection, $d);
-var_dump($d);
-
-?>
-]]>
-
- &example.outputs.similar;
-
-
- int(2)
- ["_id"]=>
- object(MongoId)#4 (0) {
- }
-}
-array(1) {
- ["x"]=>
- int(3)
-}
-array(2) {
- ["x"]=>
- int(4)
- ["_id"]=>
- object(MongoId)#5 (0) {
- }
-}
-array(1) {
- ["x"]=>
- int(5)
-}
-]]>
-
-
-
-
- MongoCollection::insert acknowledged write example
-
- This example shows inserting two elements with the same _id, which causes
- a MongoCursorException to be thrown, as
- w was set.
-
-
- "Joe", "age" => 20);
-$collection->insert($person);
-
-// now $person has an _id field, so if we save it
-// again, we will get an exception
-try {
- $collection->insert($person, array("w" => 1));
-} catch(MongoCursorException $e) {
- echo "Can't save the same person twice!\n";
-}
-
-?>
-]]>
-
-
-
-
-
- &reftitle.seealso;
-
- MongoCollection::batchInsert
- MongoCollection::update
- MongoCollection::find
- MongoCollection::remove
- MongoDB core docs on insert.
-
-
-
-
-
diff --git a/reference/mongo/mongocollection/parallelcollectionscan.xml b/reference/mongo/mongocollection/parallelcollectionscan.xml
deleted file mode 100644
index 05ae02236a..0000000000
--- a/reference/mongo/mongocollection/parallelcollectionscan.xml
+++ /dev/null
@@ -1,122 +0,0 @@
-
-
-
-
-
- MongoCollection::parallelCollectionScan
- Returns an array of cursors to iterator over a full collection in parallel
-
-
- &reftitle.description;
-
- publicarray[MongoCommandCursor]MongoCollection::parallelCollectionScan
- intnum_cursors
-
-
- This method returns an array of a maximum of num_cursors
- cursors. An iteration over one of the returned cursors results in a partial
- set of documents for a collection. Iteration over all the returned cursors
- results in getting every document back from the collection.
-
-
- This method is a wrapper for the parallelCollectionScan
- MongoDB command.
-
-
-
-
- &reftitle.parameters;
-
-
-
-
- num_cursors
-
-
-
- The number of cursors to request from the server. Please note, that the
- server can return less cursors than you requested.
-
-
-
-
-
-
-
-
- &reftitle.returnvalues;
-
- Returns an array of MongoCommandCursor objects.
-
-
-
-
- &reftitle.examples;
-
- MongoCollection::parallelCollectionScan example
-
- Returning all documents in a collection by using multiple cursors.
-
-
-demo->cities;
-
-/* Request three cursors */
-$cursors = $c->parallelCollectionScan( 3 );
-
-/* Add all the cursors to the MultipleIterator */
-$mi = new MultipleIterator( MultipleIterator::MIT_NEED_ANY );
-foreach ( $cursors as $cursor )
-{
- $mi->attachIterator( $cursor );
-}
-
-/* Iterate over all the associated cursors */
-foreach ( $mi as $items )
-{
- foreach ( $items as $item )
- {
- if ( $item !== NULL )
- {
- echo $item['name'], "\n";
- }
- }
-}
-?>
-]]>
-
-
-
-
-
- &reftitle.seealso;
-
-
- MultipleIterator
- MongoCommandCursor
- MongoDB::command
-
-
-
-
-
diff --git a/reference/mongo/mongocollection/remove.xml b/reference/mongo/mongocollection/remove.xml
deleted file mode 100644
index f264d54dd1..0000000000
--- a/reference/mongo/mongocollection/remove.xml
+++ /dev/null
@@ -1,239 +0,0 @@
-
-
-
-
-
- MongoCollection::remove
- Remove records from this collection
-
-
-
- &reftitle.description;
-
- publicboolarrayMongoCollection::remove
- arraycriteriaarray()
- arrayoptionsarray()
-
-
-
-
- &reftitle.parameters;
-
-
-
-
- criteria
-
-
-
- Query criteria for the documents to delete.
-
-
-
-
-
- options
-
-
-
- An array of options for the remove operation. Currently available options
- include:
-
- &mongo.writes.parameters.writeconcern;
-
-
- "justOne"
-
-
- Specify &true; to limit deletion to just one document. If &false; or
- omitted, all documents matching the criteria will be deleted.
-
-
- &mongo.writes.parameters.fsync;
- &mongo.writes.parameters.journal;
- &mongo.writes.parameters.sockettimeoutms;
- &mongo.writes.parameters.writeconcern;
- &mongo.writes.parameters.writeconcerntimeoutms;
-
-
-
- The following options are deprecated and should no longer be used:
-
- &mongo.writes.parameters.safe;
- &mongo.writes.parameters.timeout;
- &mongo.writes.parameters.writeconcerntimeout;
-
-
-
-
-
-
-
-
-
- &reftitle.returnvalues;
-
- Returns an array containing the status of the removal if the
- "w" option is set. Otherwise, returns &true;.
-
-
- Fields in the status array are described in the documentation for
- MongoCollection::insert.
-
-
-
-
- &reftitle.errors;
- &mongo.errors.exceptions.writeconcern;
-
-
-
- &reftitle.changelog;
-
-
-
-
-
- &Version;
- &Description;
-
-
-
-
- PECL mongo 1.5.0
-
-
- Added "wTimeoutMS" option, which replaces
- "wtimeout". Emits E_DEPRECATED
- when "wtimeout" is used.
-
-
- Added "socketTimeoutMS" option, which replaces
- "timeout". Emits E_DEPRECATED
- when "timeout" is used.
-
-
- Emits E_DEPRECATED when "safe"
- is used.
-
-
-
-
- PECL mongo 1.3.4
- Added "wtimeout" option.
-
-
- PECL mongo 1.3.0
-
- Added "w" option.
-
- The options parameter no longer accepts a
- boolean to signify "justOne". Instead, this now has
- to be done with array('justOne' => true).
-
-
-
-
- PECL mongo 1.2.11
-
- Emits E_DEPRECATED when
- options is scalar.
-
-
-
- PECL mongo 1.2.0
- Added "timeout" option.
-
-
- PECL mongo 1.0.11
-
- Disconnects on "not master" errors if "safe" is set.
-
-
-
- PECL mongo 1.0.9
-
-
- Added ability to pass integers to the "safe" option,
- which previously only accepted booleans.
-
-
- Added "fsync" option.
-
-
- The return type was changed to be an array containing error information
- if the "safe" option is used. Otherwise, a boolean
- is returned as before.
-
-
-
-
- PECL mongo 1.0.5
-
- Changed second parameter to be an array of options. Pre-1.0.5, the
- second parameter was a boolean indicating the "safe"
- option.
-
-
-
-
-
-
-
-
-
- &reftitle.examples;
-
- MongoCollection::remove with justOne example
-
-radioactive;
-
-// count how much more plutonium there is
-$remaining = $radioactive->count(array('type' => 94));
-
-$halflife = $remaining/2;
-
-// remove half of it
-while ($halflife > 0) {
- $radioactive->remove(array('type' => 94), array("justOne" => true));
- $halflife--;
-}
-
-?>
-]]>
-
-
-
-
-
- &reftitle.seealso;
-
- MongoCollection::insert
- MongoCollection::update
- MongoDB core docs on remove.
-
-
-
-
-
diff --git a/reference/mongo/mongocollection/save.xml b/reference/mongo/mongocollection/save.xml
deleted file mode 100644
index ff90de74b5..0000000000
--- a/reference/mongo/mongocollection/save.xml
+++ /dev/null
@@ -1,210 +0,0 @@
-
-
-
-
-
- MongoCollection::save
- Saves a document to this collection
-
-
-
- &reftitle.description;
-
- publicmixedMongoCollection::save
- arrayobjectdocument
- arrayoptionsarray()
-
-
- If the object is from the database, update the existing database object, otherwise
- insert this object.
-
-
-
-
- &reftitle.parameters;
-
-
-
-
- document
-
-
-
- Array or object to save. If an object is used, it may not have protected
- or private properties.
-
-
-
- If the parameter does not have an _id key or
- property, a new MongoId instance will be created
- and assigned to it. See MongoCollection::insert for
- additional information on this behavior.
-
-
-
-
-
-
- options
-
-
-
- Options for the save.
-
- &mongo.writes.parameters.fsync;
- &mongo.writes.parameters.journal;
- &mongo.writes.parameters.sockettimeoutms;
- &mongo.writes.parameters.writeconcern;
- &mongo.writes.parameters.writeconcerntimeout;
- &mongo.writes.parameters.writeconcerntimeoutms;
- &mongo.writes.parameters.safe;
- &mongo.writes.parameters.timeout;
-
-
-
-
-
-
-
-
-
- &reftitle.returnvalues;
-
- If w was set, returns an array containing the status of the save.
- Otherwise, returns a boolean representing if the array was not empty (an empty array will not
- be inserted).
-
-
-
-
- &reftitle.errors;
-
- Throws MongoException if the inserted document is
- empty or if it contains zero-length keys. Attempting to insert an object with
- protected and private properties will cause a zero-length key error.
-
- &mongo.errors.exceptions.writeconcern;
-
-
-
- &reftitle.changelog;
-
-
-
-
-
- &Version;
- &Description;
-
-
-
-
- PECL mongo 1.5.0
-
-
- Added "wTimeoutMS" option, which replaces
- "wtimeout". Emits E_DEPRECATED
- when "wtimeout" is used.
-
-
- Added "socketTimeoutMS" option, which replaces
- "timeout". Emits E_DEPRECATED
- when "timeout" is used.
-
-
- Emits E_DEPRECATED when "safe"
- is used.
-
-
-
-
- PECL mongo 1.2.0
- Added "timeout" option.
-
-
- PECL mongo 1.0.11
-
- Disconnects on "not master" errors if "safe" is set.
-
-
-
- PECL mongo 1.0.9
-
-
- Added "fsync" option.
-
-
-
-
- PECL mongo 1.0.5
- Added options parameter.
-
-
-
-
-
-
-
-
- &reftitle.examples;
-
- MongoCollection::save example
-
- 1);
-
-// insert $obj into the db
-$collection->save($obj);
-var_dump($obj);
-
-// add another field
-$obj['foo'] = 'bar';
-
-// $obj cannot be inserted again, causes duplicate _id error
-$collection->insert($obj);
-
-// save updates $obj with the new field
-$collection->save($obj);
-
-?>
-]]>
-
- &example.outputs.similar;
-
-
- int(1)
- ["_id"]=>
- object(MongoId)#4 (1) {
- ["$id"]=>
- string(24) "50b6afe544415ed606000000"
- }
-}
-]]>
-
-
-
-
-
-
diff --git a/reference/mongo/mongocollection/setreadpreference.xml b/reference/mongo/mongocollection/setreadpreference.xml
deleted file mode 100644
index 3c8786865a..0000000000
--- a/reference/mongo/mongocollection/setreadpreference.xml
+++ /dev/null
@@ -1,86 +0,0 @@
-
-
-
-
-
- MongoCollection::setReadPreference
- Set the read preference for this collection
-
-
-
- &reftitle.description;
-
- publicboolMongoCollection::setReadPreference
- stringread_preference
- arraytags
-
-
-
-
- &reftitle.parameters;
- &mongo.setreadpreference.parameters;
-
-
-
- &reftitle.returnvalues;
- &mongo.setreadpreference.returnvalues;
-
-
-
- &reftitle.errors;
- &mongo.setreadpreference.errors;
-
-
-
- &reftitle.examples;
-
- MongoCollection::setReadPreference tag set array syntax example
-
-test->users;
-
-// Prefer the nearest server in the "east" data center also used for reporting,
-// but fall back to a server in the "west" data center
-$c->setReadPreference(MongoClient::RP_NEAREST, array(
- array('dc' => 'east', 'use' => 'reporting'),
- array('dc' => 'west'),
-));
-?>
-]]>
-
-
-
-
-
- &reftitle.seealso;
-
- The read preferences documentation.
- MongoCollection::getReadPreference
-
-
-
-
-
-
diff --git a/reference/mongo/mongocollection/setslaveokay.xml b/reference/mongo/mongocollection/setslaveokay.xml
deleted file mode 100644
index 0ff9b3e0f4..0000000000
--- a/reference/mongo/mongocollection/setslaveokay.xml
+++ /dev/null
@@ -1,99 +0,0 @@
-
-
-
-
-
- MongoCollection::setSlaveOkay
- Change slaveOkay setting for this collection
-
-
-
- &reftitle.description;
-
- publicboolMongoCollection::setSlaveOkay
- boolok&true;
-
-
-
- See the query section of this manual for
- information on distributing reads to secondaries.
-
-
-
-
- &reftitle.parameters;
-
-
-
-
- ok
-
-
-
- If reads should be sent to secondary members of a replica set for all
- possible queries using this MongoCollection
- instance.
-
-
-
-
-
-
-
-
- &reftitle.returnvalues;
-
- Returns the former value of slaveOkay for this instance.
-
-
-
-
- &reftitle.changelog;
-
-
-
-
-
- &Version;
- &Description;
-
-
-
-
- PECL mongo 1.2.11
- Emits E_DEPRECATED when used.
-
-
-
-
-
-
-
-
- &reftitle.seealso;
-
-
- MongoCollection::setReadPreference
-
-
-
-
-
diff --git a/reference/mongo/mongocollection/setwriteconcern.xml b/reference/mongo/mongocollection/setwriteconcern.xml
deleted file mode 100644
index b34470aff3..0000000000
--- a/reference/mongo/mongocollection/setwriteconcern.xml
+++ /dev/null
@@ -1,83 +0,0 @@
-
-
-
-
-
- MongoCollection::setWriteConcern
- Set the write concern for this database
-
-
-
- &reftitle.description;
-
- publicboolMongoCollection::setWriteConcern
- mixedw
- intwtimeout
-
-
-
-
- &reftitle.parameters;
- &mongo.setwriteconcern.parameters;
-
-
-
- &reftitle.returnvalues;
- &mongo.setwriteconcern.returnvalues;
-
-
-
- &reftitle.errors;
- &mongo.setwriteconcern.errors;
-
-
-
- &reftitle.examples;
-
- MongoDB::setWriteConcern example
-
-selectCollection('test', 'foo');
-
-// Require that the majority of servers in the replica set acknowledge writes
-// within three seconds.
-$coll->setWriteConcern('majority', 3000);
-?>
-]]>
-
-
-
-
-
- &reftitle.seealso;
-
- The write concern documentation.
- MongoCollection::getWriteConcern
-
-
-
-
-
-
diff --git a/reference/mongo/mongocollection/toindexstring.xml b/reference/mongo/mongocollection/toindexstring.xml
deleted file mode 100644
index 0c6ec1eea8..0000000000
--- a/reference/mongo/mongocollection/toindexstring.xml
+++ /dev/null
@@ -1,128 +0,0 @@
-
-
-
-
-
- MongoCollection::toIndexString
- Converts keys specifying an index to its identifying string
-
-
-
- &reftitle.description;
-
- static protectedstringMongoCollection::toIndexString
- mixedkeys
-
-
-
- This method is deprecated since version 1.5.0.
-
-
-
-
-
- &reftitle.parameters;
-
-
-
-
- keys
-
-
-
- Field or fields to convert to the identifying string
-
-
-
-
-
-
-
-
- &reftitle.returnvalues;
-
- Returns a string that describes the index.
-
-
-
-
- &reftitle.examples;
-
- MongoCollection::toIndexString example
- This example shows how you can create an index name out of keys.
- Because this is a protected (static) method, you need to overload it in a
- child class first.
-
- 1, 'age' => -1)), "\n";
-// Outputs: name_1_age_-1
-?>
-]]>
-
-
-
-
-
- &reftitle.seealso;
-
- MongoDB core docs on indexes.
-
-
-
-
- &reftitle.changelog;
-
-
-
-
-
- &Version;
- &Description;
-
-
-
-
- PECL mongo 1.5.0
-
- This method has been deprecated.
-
-
-
-
-
-
-
-
-
-
diff --git a/reference/mongo/mongocollection/tostring.xml b/reference/mongo/mongocollection/tostring.xml
deleted file mode 100644
index 56872128e5..0000000000
--- a/reference/mongo/mongocollection/tostring.xml
+++ /dev/null
@@ -1,77 +0,0 @@
-
-
-
-
-
- MongoCollection::__toString
- String representation of this collection
-
-
- &reftitle.description;
-
- publicstringMongoCollection::__toString
-
-
-
-
-
- &reftitle.parameters;
- &no.function.parameters;
-
-
-
- &reftitle.returnvalues;
-
- Returns the full name of this collection.
-
-
-
- &reftitle.examples;
-
-
- MongoCollection::__toString example
-
-foo->bar->baz;
-echo "Working with collection $c1.";
-
-$c2 = $m->selectCollection('[]', '&');
-echo "Working with collection $c2.";
-
-?>
-]]>
-
- &example.outputs.similar;
-
-
-
-
-
-
-
-
diff --git a/reference/mongo/mongocollection/update.xml b/reference/mongo/mongocollection/update.xml
deleted file mode 100644
index 19c468acd8..0000000000
--- a/reference/mongo/mongocollection/update.xml
+++ /dev/null
@@ -1,395 +0,0 @@
-
-
-
-
-
- MongoCollection::update
- Update records based on a given criteria
-
-
-
- &reftitle.description;
-
- publicboolarrayMongoCollection::update
- arraycriteria
- arraynew_object
- arrayoptionsarray()
-
-
-
-
- &reftitle.parameters;
-
-
-
-
- criteria
-
-
-
- Query criteria for the documents to update.
-
-
-
-
-
- new_object
-
-
-
- The object used to update the matched documents. This may either contain
- update operators (for modifying specific fields) or be a replacement
- document.
-
-
-
-
-
- options
-
-
-
- An array of options for the update operation. Currently available options
- include:
-
-
-
- "upsert"
-
-
- If no document matches $criteria, a new
- document will be inserted.
-
-
- If a new document would be inserted and
- $new_object contains atomic modifiers
- (i.e. $ operators), those operations will be
- applied to the $criteria parameter to create
- the new document. If $new_object does not
- contain atomic modifiers, it will be used as-is for the inserted
- document. See the upsert examples below for more information.
-
-
-
-
- "multiple"
-
-
- All documents matching $criteria will be updated.
- MongoCollection::update has exactly the opposite
- behavior of MongoCollection::remove: it updates
- one document by default, not all matching documents. It is
- recommended that you always specify whether you want to update
- multiple documents or a single document, as the database
- may change its default behavior at some point in the future.
-
-
- &mongo.writes.parameters.fsync;
- &mongo.writes.parameters.journal;
- &mongo.writes.parameters.sockettimeoutms;
- &mongo.writes.parameters.writeconcern;
- &mongo.writes.parameters.writeconcerntimeoutms;
-
-
-
- The following options are deprecated and should no longer be used:
-
- &mongo.writes.parameters.safe;
- &mongo.writes.parameters.timeout;
- &mongo.writes.parameters.writeconcerntimeout;
-
-
-
-
-
-
-
-
-
- &reftitle.returnvalues;
-
- Returns an array containing the status of the update if the
- "w" option is set. Otherwise, returns &true;.
-
-
- Fields in the status array are described in the documentation for
- MongoCollection::insert.
-
-
-
-
- &reftitle.errors;
- &mongo.errors.exceptions.writeconcern;
-
-
-
- &reftitle.changelog;
-
-
-
-
-
- &Version;
- &Description;
-
-
-
-
- PECL mongo 1.5.0
-
-
- Added the "wTimeoutMS" option, which replaces
- "wtimeout". Emits E_DEPRECATED
- when "wtimeout" is used.
-
-
- Added the "socketTimeoutMS" option, which replaces
- "timeout". Emits E_DEPRECATED
- when "timeout" is used.
-
-
- Emits E_DEPRECATED when "safe"
- is used.
-
-
-
-
- PECL mongo 1.3.4
- Added "wtimeout" option.
-
-
- PECL mongo 1.3.0
-
- Added "w" option.
-
- The options parameter no longer accepts a boolean
- to signify an upsert. Instead, this now has to be done with
- array('upsert' => true).
-
-
-
-
- PECL mongo 1.2.11
-
- Emits E_DEPRECATED when
- options is scalar.
-
-
-
- PECL mongo 1.2.0
- Added "timeout" option.
-
-
- PECL mongo 1.0.11
-
- Disconnects on "not master" errors if "safe" is set.
-
-
-
- PECL mongo 1.0.9
-
-
- Added ability to pass integers to the "safe" option,
- which previously only accepted booleans.
-
-
- Added "fsync" option.
-
-
- The return type was changed to be an array containing error information
- if the "safe" option is used. Otherwise, a boolean
- is returned as before.
-
-
-
-
- PECL mongo 1.0.5
- Added "safe" option.
-
-
- PECL mongo 1.0.1
-
- Changed options parameter from boolean to array.
- Pre-1.0.1, the second parameter was an optional boolean value specifying
- an upsert.
-
-
-
-
-
-
-
-
-
- &reftitle.examples;
-
- MongoCollection::update
-
- Adding an address field to a document.
-
-
-insert(array("firstname" => "Bob", "lastname" => "Jones" ));
-$newdata = array('$set' => array("address" => "1 Smith Lane"));
-$c->update(array("firstname" => "Bob"), $newdata);
-
-var_dump($c->findOne(array("firstname" => "Bob")));
-
-?>
-]]>
-
- &example.outputs.similar;
-
-
- object(MongoId)#6 (0) {
- }
- ["firstname"]=>
- string(3) "Bob"
- ["lastname"]=>
- string(5) "Jones"
- ["address"]=>
- string(12) "1 Smith Lane"
-}
-]]>
-
-
-
- MongoCollection::update upsert examples
-
- Upserts can simplify code, as a single line can create the document if it
- does not exist (based on $criteria), or update an
- existing document if it matches.
-
-
- In the following example, $new_object contains an
- atomic modifier. Since the collection is empty and upsert must insert a new
- document, it will apply those operations to the
- $criteria parameter in order to create the document.
-
-
-drop();
-$c->update(
- array("uri" => "/summer_pics"),
- array('$inc' => array("page hits" => 1)),
- array("upsert" => true)
-);
-var_dump($c->findOne());
-
-?>
-]]>
-
- &example.outputs.similar;
-
-
- object(MongoId)#9 (0) {
- }
- ["uri"]=>
- string(12) "/summer_pics"
- ["page hits"]=>
- int(1)
-}
-]]>
-
-
- If $new_object does not contain atomic modifiers
- (i.e. $ operators), upsert will use
- $new_object as-is for the new document. This matches
- the behavior of a normal update, where not using atomic modifiers causes the
- document to be overwritten.
-
-
-drop();
-$c->update(
- array("name" => "joe"),
- array("username" => "joe312", "createdAt" => new MongoDate()),
- array("upsert" => true)
-);
-var_dump($c->findOne());
-
-?>
-]]>
-
- &example.outputs.similar;
-
-
- object(MongoId)#10 (0) {
- }
- ["username"]=>
- string(6) "joe312"
- ["createdAt"]=>
- object(MongoDate)#4 (0) {
- }
-}
-]]>
-
-
-
- MongoCollection::update multiple example
-
- By default, MongoCollection::update will only update
- the first document matching $criteria that it
- finds. Using the "multiple" option can override this behavior, if needed.
-
-
- This example adds a "gift" field to every person whose birthday is in the
- next day.
-
-
- new MongoDate(), '$lt' => new MongoDate(strtotime("+1 day")));
-$people->update(
- array("birthday" => $today),
- array('$set' => array('gift' => $surprise)),
- array("multiple" => true)
-);
-
-?>
-]]>
-
-
-
-
-
- &reftitle.seealso;
-
- The PHP documentation on updates and the
- MongoDB core docs.
-
-
-
-
-
diff --git a/reference/mongo/mongocollection/validate.xml b/reference/mongo/mongocollection/validate.xml
deleted file mode 100644
index 36c88ce5b7..0000000000
--- a/reference/mongo/mongocollection/validate.xml
+++ /dev/null
@@ -1,61 +0,0 @@
-
-
-
-
-
- MongoCollection::validate
- Validates this collection
-
-
-
- &reftitle.description;
-
- publicarrayMongoCollection::validate
- boolscan_data&false;
-
-
-
-
- &reftitle.parameters;
-
-
-
-
- scan_data
-
-
-
- Only validate indices, not the base collection.
-
-
-
-
-
-
-
-
- &reftitle.returnvalues;
-
- Returns the database's evaluation of this object.
-
-
-
-
diff --git a/reference/mongo/mongocommandcursor.xml b/reference/mongo/mongocommandcursor.xml
deleted file mode 100644
index 000209c873..0000000000
--- a/reference/mongo/mongocommandcursor.xml
+++ /dev/null
@@ -1,132 +0,0 @@
-
-
-
-
-
- The MongoCommandCursor class
- MongoCommandCursor
-
-
-
-
-
- &reftitle.intro;
-
- A command cursor is similar to a MongoCursor except
- that you use it for iterating through the results of a database command
- instead of a normal query. Command cursors are useful for iterating over
- large result sets that might exceed the document size limit (currently 16MB)
- of a single MongoDB::command response.
-
-
- While you can create command cursors using
- MongoCommandCursor::__construct or the
- MongoCommandCursor::createFromDocument factory method,
- you will generally want to use command-specific helpers such as
- MongoCollection::aggregateCursor.
-
-
- Note that the cursor does not "contain" the database command's results; it
- just manages iteration through them. Thus, if you print a cursor (f.e. with
- var_dump or print_r), you will see
- the cursor object but not the result documents.
-
-
-
-
- Cursor Stages
-
- A MongoCommandCursor has two "life stages": pre-
- and post- command. When a cursor is created, it has not yet contacted the
- database, so it is in its pre-command state. When the client first attempts
- to get a result (by calling MongoCommandCursor::rewind,
- directly or indirectly), the cursor moves into the post-command state.
-
-
- The command cursor's batch size and socket timeout may be configured in both
- the pre- and post- command states.
-
-
-
- Adding options to MongoCommandCursor
-
-batchSize( 4 );
-
-foreach ($cursor as $result) {
- var_dump($result);
-}
-?>
-]]>
-
-
-
-
-
-
-
- &reftitle.classsynopsis;
-
-
-
- MongoCommandCursor
-
-
-
-
- MongoCommandCursor
-
-
- MongoCursorInterface
-
-
- Iterator
-
-
-
-
- &Methods;
-
-
-
-
-
-
-
- &reftitle.seealso;
-
- MongoDB::command
- MongoCollection::aggregateCursor
-
-
-
-
-
- &reference.mongo.entities.mongocommandcursor;
-
-
-
-
diff --git a/reference/mongo/mongocommandcursor/batchsize.xml b/reference/mongo/mongocommandcursor/batchsize.xml
deleted file mode 100644
index ef8f6b7dfd..0000000000
--- a/reference/mongo/mongocommandcursor/batchsize.xml
+++ /dev/null
@@ -1,93 +0,0 @@
-
-
-
-
-
- MongoCommandCursor::batchSize
- Limits the number of elements returned in one batch
-
-
-
- &reftitle.description;
-
- publicMongoCommandCursorMongoCommandCursor::batchSize
- intbatchSize
-
-
- A cursor typically fetches a batch of result objects and store them
- locally. This method sets the batchSize value to configure the amount of
- documents retrieved from the server in one round trip.
-
-
-
-
- &reftitle.parameters;
-
-
-
-
- batchSize
-
-
-
- The number of results to return per batch. Each batch requires a
- round-trip to the server.
-
-
- This cannot override MongoDB's limit on the amount of data it will return to
- the client (i.e., if you set batch size to 1,000,000,000, MongoDB will still
- only return 4-16MB of results per batch).
-
-
-
-
-
-
-
-
- &reftitle.returnvalues;
-
- Returns this cursor.
-
-
-
-
- &reftitle.examples;
-
- MongoCommandCursor::batchSize
-
-batchSize(20);
-?>
-]]>
-
-
-
-
-
- &reftitle.seealso;
-
- MongoCursorInterface::batchSize
-
-
-
-
diff --git a/reference/mongo/mongocommandcursor/construct.xml b/reference/mongo/mongocommandcursor/construct.xml
deleted file mode 100644
index 77ffca28ce..0000000000
--- a/reference/mongo/mongocommandcursor/construct.xml
+++ /dev/null
@@ -1,142 +0,0 @@
-
-
-
-
-
- MongoCommandCursor::__construct
- Create a new command cursor
-
-
-
- &reftitle.description;
-
- publicMongoCommandCursor::__construct
- MongoClientconnection
- stringns
- arraycommandarray()
-
-
- Generally, you should not have to construct a
- MongoCommandCursor manually, as there are helper
- functions such as MongoCollection::aggregateCursor
- and MongoCollection::parallelCollectionScan;
- however, if the server introduces new commands that can return cursors, this
- constructor will be useful in the absence of specific helper methods. You may
- also consider using
- MongoCommandCursor::createFromDocument.
-
-
-
-
- &reftitle.parameters;
-
-
-
-
- connection
-
-
-
- Database connection.
-
-
-
-
-
- ns
-
-
-
- Full name of the database and collection (e.g.
- "test.foo")
-
-
-
-
-
- command
-
-
-
- Database command.
-
-
-
-
-
-
-
-
- &reftitle.returnvalues;
-
- Returns the new cursor.
-
-
-
-
- &reftitle.examples;
-
- MongoCommandCursor example
-
- [
- '_id' => '$country_code',
- 'timezones' => [ '$addToSet' => '$timezone' ]
- ] ],
- [ '$sort' => [ '_id' => 1 ] ],
-];
-
-// Construct a MongoCommandCursor object
-$cursor = new MongoCommandCursor(
- $m, // MongoClient object
- 'demo.cities', // namespace
- [
- 'aggregate' => 'cities',
- 'pipeline' => $pipeline,
- 'cursor' => [ 'batchSize' => 0 ],
- ]
-);
-
-foreach($cursor as $result) {
- …
-}
-?>
-]]>
-
-
-
-
-
- &reftitle.seealso;
-
- MongoCommandCursor::createFromDocument
- MongoCollection::aggregateCursor
- MongoCollection::parallelCollectionScan
-
-
-
-
-
diff --git a/reference/mongo/mongocommandcursor/createfromdocument.xml b/reference/mongo/mongocommandcursor/createfromdocument.xml
deleted file mode 100644
index bbcf2fdb33..0000000000
--- a/reference/mongo/mongocommandcursor/createfromdocument.xml
+++ /dev/null
@@ -1,182 +0,0 @@
-
-
-
-
-
- MongoCommandCursor::createFromDocument
- Create a new command cursor from an existing command response document
-
-
-
- &reftitle.description;
-
- publicstaticMongoCommandCursorMongoCommandCursor::createFromDocument
- MongoClientconnection
- stringhash
- arraydocument
-
-
- Use this method if you have a raw command result with cursor information in
- it. Note that cursors created with this method cannot be iterated multiple
- times, as they will lack the original command necessary for re-execution.
-
-
-
-
- &reftitle.parameters;
-
-
-
-
- connection
-
-
-
- Database connection.
-
-
-
-
-
- hash
-
-
-
- The connection hash, as obtained through the third by-reference argument
- to MongoDB::command.
-
-
-
-
-
- document
-
-
-
- Document with cursor information in it. This document needs to contain
- the id, ns and
- firstBatch fields. Such a document is obtained by
- calling the MongoDB::command with appropriate
- arguments to return a cursor, and not just an inline result. See the
- example below.
-
-
-
-
-
-
-
-
- &reftitle.returnvalues;
-
- Returns the new cursor.
-
-
-
-
- &reftitle.examples;
-
- MongoCommandCursor::createFromDocument
-
-demo;
-
-// Define the aggregation pipeline
-$pipeline = [
- [ '$group' => [
- '_id' => '$country_code',
- 'timezones' => [ '$addToSet' => '$timezone' ]
- ] ],
- [ '$sort' => [ '_id' => 1 ] ],
-];
-
-// Execute the command. The "cursor" option instructs the server to return
-// cursor information in the response instead of inline results.
-$r = $d->command(
- [
- 'aggregate' => 'cities',
- 'pipeline' => $pipeline,
- 'cursor' => [ 'batchSize' => 1 ],
- ],
- null,
- $hash
-);
-
-// Show result and hash
-var_dump( $r, $hash );
-
-// Construct the command cursor
-$cursor = MongoCommandCursor::createFromDocument( $m, $hash, $r );
-?>
-]]>
-
- &example.outputs.similar;
-
-
- array(3) {
- ["id"]=>
- object(MongoInt64)#5 (1) {
- ["value"]=>
- string(12) "392143983421"
- }
- ["ns"]=>
- string(11) "demo.cities"
- ["firstBatch"]=>
- array(1) {
- [0]=>
- array(2) {
- ["_id"]=>
- string(2) "AD"
- ["timezones"]=>
- array(1) {
- [0]=>
- string(14) "Europe/Andorra"
- }
- }
- }
- }
- ["ok"]=>
- float(1)
-}
-string(25) "localhost:27017;-;.;17617"
-]]>
-
-
- As you can see, the returned cursor information has the
- id, ns and
- firstBatch fields.
-
-
-
-
-
- &reftitle.seealso;
-
- MongoCommandCursor::__construct
-
-
-
-
-
diff --git a/reference/mongo/mongocommandcursor/current.xml b/reference/mongo/mongocommandcursor/current.xml
deleted file mode 100644
index 47a6d66e9c..0000000000
--- a/reference/mongo/mongocommandcursor/current.xml
+++ /dev/null
@@ -1,59 +0,0 @@
-
-
-
-
-
- MongoCommandCursor::current
- Returns the current element
-
-
-
- &reftitle.description;
-
- publicarrayMongoCommandCursor::current
-
-
-
- This returns &null; until MongoCommandCursor::rewind is called.
-
-
-
-
- &reftitle.parameters;
- &no.function.parameters;
-
-
-
- &reftitle.returnvalues;
-
- The current result document as an associative array. &null; will be returned
- if there is no result.
-
-
-
-
- &reftitle.seealso;
-
- Iterator::current
-
-
-
-
diff --git a/reference/mongo/mongocommandcursor/dead.xml b/reference/mongo/mongocommandcursor/dead.xml
deleted file mode 100644
index 59dbe73cd0..0000000000
--- a/reference/mongo/mongocommandcursor/dead.xml
+++ /dev/null
@@ -1,62 +0,0 @@
-
-
-
-
-
- MongoCommandCursor::dead
- Checks if there are results that have not yet been sent from the database
-
-
-
- &reftitle.description;
-
- publicboolMongoCommandCursor::dead
-
-
-
- This method checks whether the MongoCommandCursor
- cursor has been exhausted and the database has no more results to send to the
- client. A cursor being "dead" does not necessarily mean that there are no
- more results available for iteration.
-
-
-
-
- &reftitle.parameters;
- &no.function.parameters;
-
-
-
- &reftitle.returnvalues;
-
- Returns &true; if there are more results that have not yet been sent to the
- client, and &false; otherwise.
-
-
-
-
- &reftitle.seealso;
-
- MongoCursorInterface::dead
-
-
-
-
diff --git a/reference/mongo/mongocommandcursor/getreadpreference.xml b/reference/mongo/mongocommandcursor/getreadpreference.xml
deleted file mode 100644
index 478a3eb3c1..0000000000
--- a/reference/mongo/mongocommandcursor/getreadpreference.xml
+++ /dev/null
@@ -1,96 +0,0 @@
-
-
-
-
-
- MongoCommandCursor::getReadPreference
- Get the read preference for this command
-
-
-
- &reftitle.description;
-
- publicarrayMongoCommandCursor::getReadPreference
-
-
-
-
-
- &reftitle.parameters;
- &no.function.parameters;
-
-
-
- &reftitle.returnvalues;
- &mongo.getreadpreference.returnvalues;
-
-
-
- &reftitle.examples;
-
- MongoCommandCursor::getReadPreference return value example
-
- 'myReplSetName'));
-$collection = $m->selectCollection('test', 'people');
-
-// If a MongoCommandCursor is constructed directly, it will inherit the read
-// preference of the MongoClient instance passed to its constructor; however,
-// MongoCollection::aggregateCursor() will have the MongoCommandCursor inherit
-// the collection's read preference.
-$collection->setReadPreference(MongoClient::RP_SECONDARY);
-
-$cursor = $collection->aggregateCursor( [
- [ '$group' => [ '_id' => '$name', 'points' => [ '$sum' => '$points' ] ] ],
- [ '$sort' => [ 'points' => -1 ] ],
-] );
-
-var_dump($cursor->getReadPreference());
-
-?>
-]]>
-
- &example.outputs;
-
-
- string(9) "secondary"
-}
-]]>
-
-
-
-
-
- &reftitle.seealso;
-
- The read preferences documentation.
- MongoCommandCursor::setReadPreference
- MongoCursorInterface::getReadPreference
-
-
-
-
-
diff --git a/reference/mongo/mongocommandcursor/info.xml b/reference/mongo/mongocommandcursor/info.xml
deleted file mode 100644
index 7d562d7b36..0000000000
--- a/reference/mongo/mongocommandcursor/info.xml
+++ /dev/null
@@ -1,198 +0,0 @@
-
-
-
-
-
- MongoCommandCursor::info
- Gets information about the cursor's creation and iteration
-
-
-
- &reftitle.description;
-
- publicarrayMongoCommandCursor::info
-
-
-
- This can be called before or after the cursor has started iterating.
-
-
-
-
- &reftitle.parameters;
- &no.function.parameters;
-
-
-
- &reftitle.returnvalues;
-
- Returns the namespace, batch size, limit, skip, flags, query, and projected
- fields for this cursor. If the cursor has started iterating, additional
- information about iteration and the connection will be included.
-
-
-
-
- &reftitle.examples;
-
- MongoCommandCursor::info example
-
- 'cities',
- 'pipeline' => [ [ '$match' => [ '_id' => [ '$exists' => true ] ] ] ],
- 'cursor' => [ 'batchSize' => 1 ],
- ]
-);
-
-echo "Before iteration started:\n";
-var_dump($cursor->info());
-
-echo "\nAfter iteration started:\n";
-$cursor->rewind();
-var_dump($cursor->info());
-
-?>
-]]>
-
- &example.outputs.similar;
-
-
- string(11) "demo.cities"
- ["limit"]=>
- int(0)
- ["batchSize"]=>
- int(0)
- ["skip"]=>
- int(0)
- ["flags"]=>
- int(0)
- ["query"]=>
- array(3) {
- ["aggregate"]=>
- string(6) "cities"
- ["pipeline"]=>
- array(1) {
- [0]=>
- array(1) {
- ["$match"]=>
- array(1) {
- ["_id"]=>
- array(1) {
- ["$exists"]=>
- bool(true)
- }
- }
- }
- }
- ["cursor"]=>
- array(1) {
- ["batchSize"]=>
- int(1)
- }
- }
- ["fields"]=>
- NULL
- ["started_iterating"]=>
- bool(false)
-}
-
-After iteration started:
-array(17) {
- ["ns"]=>
- string(11) "demo.cities"
- ["limit"]=>
- int(0)
- ["batchSize"]=>
- int(0)
- ["skip"]=>
- int(0)
- ["flags"]=>
- int(0)
- ["query"]=>
- array(3) {
- ["aggregate"]=>
- string(6) "cities"
- ["pipeline"]=>
- array(1) {
- [0]=>
- array(1) {
- ["$match"]=>
- array(1) {
- ["_id"]=>
- array(1) {
- ["$exists"]=>
- bool(true)
- }
- }
- }
- }
- ["cursor"]=>
- array(1) {
- ["batchSize"]=>
- int(1)
- }
- }
- ["fields"]=>
- NULL
- ["started_iterating"]=>
- bool(true)
- ["id"]=>
- int(185840310129)
- ["at"]=>
- int(0)
- ["numReturned"]=>
- int(0)
- ["server"]=>
- string(25) "localhost:27017;-;.;23991"
- ["host"]=>
- string(9) "localhost"
- ["port"]=>
- int(27017)
- ["connection_type_desc"]=>
- string(10) "STANDALONE"
- ["firstBatchAt"]=>
- int(0)
- ["firstBatchNumReturned"]=>
- int(1)
-}
-]]>
-
-
-
-
-
- &reftitle.seealso;
-
- MongoCursorInterface::info
-
-
-
-
diff --git a/reference/mongo/mongocommandcursor/key.xml b/reference/mongo/mongocommandcursor/key.xml
deleted file mode 100644
index 79df013cce..0000000000
--- a/reference/mongo/mongocommandcursor/key.xml
+++ /dev/null
@@ -1,55 +0,0 @@
-
-
-
-
-
- MongoCommandCursor::key
- Returns the current result's index within the result set
-
-
-
- &reftitle.description;
-
- publicintMongoCommandCursor::key
-
-
-
-
-
- &reftitle.parameters;
- &no.function.parameters;
-
-
-
- &reftitle.returnvalues;
-
- The current result's index within the result set.
-
-
-
-
- &reftitle.seealso;
-
- Iterator::key
-
-
-
-
diff --git a/reference/mongo/mongocommandcursor/next.xml b/reference/mongo/mongocommandcursor/next.xml
deleted file mode 100644
index cd94fad9c4..0000000000
--- a/reference/mongo/mongocommandcursor/next.xml
+++ /dev/null
@@ -1,64 +0,0 @@
-
-
-
-
-
- MongoCommandCursor::next
- Advances the cursor to the next result
-
-
-
- &reftitle.description;
-
- publicvoidMongoCommandCursor::next
-
-
-
-
-
- &reftitle.parameters;
- &no.function.parameters;
-
-
-
- &reftitle.returnvalues;
-
- &null;.
-
-
-
-
- &reftitle.errors;
-
- Throws MongoConnectionException if it cannot reach the
- database and MongoCursorTimeoutException if the
- timeout is exceeded.
-
-
-
-
- &reftitle.seealso;
-
- Iterator::next
-
-
-
-
diff --git a/reference/mongo/mongocommandcursor/rewind.xml b/reference/mongo/mongocommandcursor/rewind.xml
deleted file mode 100644
index b50aab8fd4..0000000000
--- a/reference/mongo/mongocommandcursor/rewind.xml
+++ /dev/null
@@ -1,123 +0,0 @@
-
-
-
-
-
- MongoCommandCursor::rewind
- Executes the command and resets the cursor to the start of the result set
-
-
-
- &reftitle.description;
-
- publicarrayMongoCommandCursor::rewind
-
-
-
- If the cursor has already started iteration, the command will be re-executed.
-
-
-
-
- &reftitle.parameters;
- &no.function.parameters;
-
-
-
- &reftitle.returnvalues;
-
- The raw server result document.
-
-
-
-
- &reftitle.errors;
-
- Throws MongoConnectionException if it cannot reach the
- database and MongoCursorTimeoutException if the
- timeout is exceeded.
-
-
- Throws MongoCursorException if the cursor was created
- with MongoCommandCursor::createFromDocument and has
- already started iteration. Such cursors cannot be iterated multiple times, as
- they lack the original command necessary for re-execution.
-
-
-
-
- &reftitle.examples;
-
- MongoCommandCursor::rewind
-
-rewind();
-
-// Command cursor is now reset to the start of the result set
-
-var_dump($rawResult);
-?>
-]]>
-
- &example.outputs.similar;
-
-
- array(3) {
- ["id"]=>
- object(MongoInt64)#5 (1) {
- ["value"]=>
- string(12) "310050110216"
- }
- ["ns"]=>
- string(9) "demo.test"
- ["firstBatch"]=>
- array(1) {
- [0]=>
- array(2) {
- ["_id"]=>
- object(MongoId)#6 (1) {
- ["$id"]=>
- string(24) "52f5691544670a8077b0dc51"
- }
- ["value"]=>
- string(2) "42"
- }
- }
- }
- ["ok"]=>
- float(1)
-}
-]]>
-
-
-
-
-
- &reftitle.seealso;
-
- Iterator::rewind
-
-
-
-
diff --git a/reference/mongo/mongocommandcursor/setreadpreference.xml b/reference/mongo/mongocommandcursor/setreadpreference.xml
deleted file mode 100644
index e22b77c999..0000000000
--- a/reference/mongo/mongocommandcursor/setreadpreference.xml
+++ /dev/null
@@ -1,107 +0,0 @@
-
-
-
-
-
- MongoCommandCursor::setReadPreference
- Set the read preference for this command
-
-
-
- &reftitle.description;
-
- publicMongoCommandCursorMongoCommandCursor::setReadPreference
- stringread_preference
- arraytags
-
-
-
-
- &reftitle.parameters;
- &mongo.setreadpreference.parameters;
-
-
-
- &reftitle.returnvalues;
-
- Returns this cursor.
-
-
-
-
- &reftitle.errors;
- &mongo.setreadpreference.errors;
-
-
-
- &reftitle.examples;
-
- MongoCommandCursor::setReadPreference tag set array syntax example
-
-
- 'myReplSetName'));
-$collection = $m->selectCollection('test', 'people');
-
-$cursor = $collection->aggregateCursor( [
- [ '$group' => [ '_id' => '$name', 'points' => [ '$sum' => '$points' ] ] ],
- [ '$sort' => [ 'points' => -1 ] ],
-] );
-
-// Prefer the nearest server in the "east" data center also used for reporting,
-// but fall back to a server in the "west" data center
-$cursor->setReadPreference(MongoClient::RP_NEAREST, [
- [ 'dc' => 'east', 'use' => 'reporting' ],
- [ 'dc' => 'west' ],
-] );
-
-foreach ($cursor as $person) {
- // ...
-}
-
-// If the read preference is changed, it will be used the next time the cursor
-// is rewound and the command is re-executed.
-$cursor->setReadPreference(MongoClient::RP_PRIMARY);
-
-foreach ($cursor as $person) {
- // ...
-}
-
-?>
-]]>
-
-
-
-
-
- &reftitle.seealso;
-
- The read preferences documentation.
- MongoCommandCursor::getReadPreference
- MongoCursorInterface::setReadPreference
-
-
-
-
-
diff --git a/reference/mongo/mongocommandcursor/timeout.xml b/reference/mongo/mongocommandcursor/timeout.xml
deleted file mode 100644
index 02568dab57..0000000000
--- a/reference/mongo/mongocommandcursor/timeout.xml
+++ /dev/null
@@ -1,130 +0,0 @@
-
-
-
-
-
- MongoCommandCursor::timeout
- Sets a client-side timeout for this command
-
-
-
- &reftitle.description;
-
- publicMongoCommandCursorMongoCommandCursor::timeout
- intms
-
-
- A timeout can be set at any time and will affect subsequent data retrieval
- associated with this cursor, including fetching more results from the
- database.
-
-
-
-
- &reftitle.parameters;
-
-
-
- ms
-
-
-
- The number of milliseconds for the cursor to wait for a response. Use
- -1 to wait forever. By default, the cursor will wait
- 30000 milliseconds (30 seconds).
-
-
-
-
-
-
-
- &reftitle.returnvalues;
-
- This cursor.
-
-
-
-
- &reftitle.errors;
-
- Causes methods that fetch results to throw a
- MongoCursorTimeoutException if the data fetch takes
- longer than the specified number of milliseconds.
-
-
-
-
- &reftitle.examples;
-
- MongoCommandCursor::timeout example
-
- In the following example, the driver will wait for 60 seconds for the
- first response from the aggregate command. It will also wait for 60
- seconds each time the server needs to be polled for more information.
-
-
-database->collection;
-
-$pipeline = [ … ];
-
-$cursor = $col->aggregateCursor( $pipeline );
-$cursor->timeout( 60000 ); // for 60 seconds
-
-foreach ( $cursor as $result ) {
- …
-}
-
-?>
-]]>
-
-
-
-
-
- &reftitle.notes;
-
-
- This does not cause the MongoDB server to cancel long-running operations;
- it only instructs the driver to stop waiting for a response and throw a
- MongoCursorTimeoutException after a set time.
- If you need to specify a server-side timeout for a command, considering
- passing the maxTimeMS option to
- MongoCollection::aggregateCursor.
-
-
-
-
-
- &reftitle.seealso;
-
- MongoCollection::aggregateCursor
- MongoCursorInterface::timeout
- The socketTimeoutMS option for MongoClient::__construct
-
-
-
-
-
diff --git a/reference/mongo/mongocommandcursor/valid.xml b/reference/mongo/mongocommandcursor/valid.xml
deleted file mode 100644
index 53b4ed8e81..0000000000
--- a/reference/mongo/mongocommandcursor/valid.xml
+++ /dev/null
@@ -1,55 +0,0 @@
-
-
-
-
-
- MongoCommandCursor::valid
- Checks if the cursor is reading a valid result
-
-
-
- &reftitle.description;
-
- publicboolMongoCommandCursor::valid
-
-
-
-
-
- &reftitle.parameters;
- &no.function.parameters;
-
-
-
- &reftitle.returnvalues;
-
- &true; if the current result is not null, and &false; otherwise.
-
-
-
-
- &reftitle.seealso;
-
- Iterator::valid
-
-
-
-
diff --git a/reference/mongo/mongoconnectionexception.xml b/reference/mongo/mongoconnectionexception.xml
deleted file mode 100644
index 5129d82aae..0000000000
--- a/reference/mongo/mongoconnectionexception.xml
+++ /dev/null
@@ -1,175 +0,0 @@
-
-
-
-
-
- The MongoConnectionException class
- MongoConnectionException
-
-
-
-
-
- &reftitle.intro;
-
- Thrown when the driver fails to connect to the database.
-
-
-
- There are a number of possible error messages to help you diagnose the
- connection problem. These are:
-
-
-
-
-
- No candidate servers found
-
-
- Thrown when the driver cannot establish a connection to MongoDB
- (fulfilling the ReadPreferences, if specified).
-
-
-
-
-
- No server name given.
-
-
- This error occurs if you pass in "" as the server name,
- probably because of an typo with string interpolation,
- e.g., "$servr" instead of "$server".
-
-
-
-
-
- failed to get host [hostname] or port [portnum]
- from [server].
-
-
-
- This indicated that the server string was malformed.
- "[hostname]" and "[portnum]" will be as much as the
- driver could dicipher of it.
-
-
-
-
- Operation in progress
-
-
- Connecting to the database timed out.
-
-
-
-
- Transport endpoint is not connected
-
-
- Generally means that the connection string isn't correct, the driver
- couldn't even find the database server.
-
-
-
-
- couldn't determine master
-
-
- No server in a replica set connection was identified as the primary.
-
-
-
-
- couldn't get host info for [server]
-
-
- This indicated that DNS could not resolve the server address
- you gave. This could easily be caused by a typo, for example,
- "server" instead of "$server".
-
-
-
-
- Invalid Argument
-
-
- This can be caused by attempting to connect to a machine that is up but
- that the database isn't actually running on. Make sure that you've
- started the database server before connecting.
-
-
-
-
- Permission denied
-
-
- This means that the socket could not be opened due to permissions issues.
- On Red Hat variants, this can be caused by a default setting that does not
- allow Apache to create network connections. You can override this setting
- by running:
-
-
-
- then restarting Apache.
-
-
-
-
-
- If the error message is not listed above, it is probably an error
- from the C socket, and you can search the web for its usual cause.
-
-
-
-
-
- &reftitle.classsynopsis;
-
-
-
- MongoConnectionException
-
-
-
-
- MongoConnectionException
-
-
- extends
- MongoException
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/reference/mongo/mongocursor.xml b/reference/mongo/mongocursor.xml
deleted file mode 100644
index 84dff81ef4..0000000000
--- a/reference/mongo/mongocursor.xml
+++ /dev/null
@@ -1,221 +0,0 @@
-
-
-
-
-
- The MongoCursor class
- MongoCursor
-
-
-
-
-
- &reftitle.intro;
-
- A cursor is used to iterate through the results of a database query. For
- example, to query the database and see all results, you could do:
-
- MongoCursor basic usage
-
-find();
-var_dump(iterator_to_array($cursor));
-
-?>
-]]>
-
-
-
-
- You don't generally create cursors using the
- MongoCursor constructor, you get a new cursor by
- calling MongoCollection::find (as shown above).
-
-
- Suppose that, in the example above, $collection was a
- 50GB collection. We certainly wouldn't want to load that into memory all
- at once, which is what a cursor is for: allowing the client to access the
- collection in dribs and drabs.
-
-
- If we have a large result set, we can iterate through it, loading a few
- megabytes of results into memory at a time. For example, we could do:
-
- Iterating over MongoCursor
-
-find();
-
-foreach ($cursor as $doc) {
- // do something to each document
-}
-
-?>
-]]>
-
-
- This will go through each document in the collection, loading and garbage
- collecting documents as needed.
-
-
- Note that this means that a cursor does not "contain" the database results,
- it just manages them. Thus, if you print a cursor (with, say,
- var_dump or print_r), you'll just
- get the cursor object, not your documents. To get the documents themselves,
- you can use one of the methods shown above.
-
-
-
-
- Cursor Stages
-
- A MongoCursor has two "life stages": pre- and post-
- query. When a cursor is created, it has not yet contacted the database, so
- it is in its pre-query state. In this state, the client can further specify
- what they want the query to do, including adding limits, skips, sorts, and
- more advanced options.
-
-
- When the client attempts to get a result (by calling
- MongoCursor::next, directly or indirectly), the cursor
- moves into the post-query stage. At this point, the query has been executed
- by the database and cannot be modified anymore.
-
-
-
- Adding options to MongoCursor
-
-find()->limit(10);
-
-// database has not yet been queried, so more search options can be added
-$cursor = $cursor->sort(array("a" => 1));
-
-var_dump($cursor->getNext());
-// now database has been queried and more options cannot be added
-
-// so this will throw an exception:
-$cursor->skip(4);
-?>
-]]>
-
-
-
-
-
-
-
- &reftitle.classsynopsis;
-
-
-
- MongoCursor
-
-
-
-
- MongoCursor
-
-
- MongoCursorInterface
-
-
- Iterator
-
-
-
-
- Static Fields
-
- static
- bool
- slaveOkay
- &false;
-
-
- static
- int
- timeout
- 30000
-
-
- &Methods;
-
-
-
-
-
-
-
- Static Variables
-
-
-
- slaveOkay
-
-
- If the query should have the "slaveOkay" flag set, which allows reads on
- the secondary (secondaries are, by default, just for backup and not
- queried). Can be overridden with MongoCursor::slaveOkay.
-
-
- This functionality is deprecated. Please use
- instead.
-
-
-
-
- timeout
-
-
- Set timeout in milliseconds for all database responses. Use
- -1 to wait forever. Can be overridden with
- MongoCursor::timeout. This does not cause the
- MongoDB server to cancel the operation; it only instructs the driver to
- stop waiting for a response and throw a
- MongoCursorTimeoutException after a set time.
-
-
-
-
-
-
-
- &reftitle.seealso;
-
- MongoDB core docs on cursors.
-
-
-
-
-
- &reference.mongo.entities.mongocursor;
-
-
-
-
diff --git a/reference/mongo/mongocursor/addoption.xml b/reference/mongo/mongocursor/addoption.xml
deleted file mode 100644
index 8ddd3a32a0..0000000000
--- a/reference/mongo/mongocursor/addoption.xml
+++ /dev/null
@@ -1,200 +0,0 @@
-
-
-
-
-
- MongoCursor::addOption
- Adds a top-level key/value pair to a query
-
-
-
- &reftitle.description;
-
- publicMongoCursorMongoCursor::addOption
- stringkey
- mixedvalue
-
-
- This is an advanced function and should not be used unless you know what
- you're doing.
-
-
- A query can optionally be nested in a "query" field if other options, such as
- a sort or hint, are given. For instance, adding a sort causes the query
- to become a subfield of a bigger query object, like:
-
- $query, "orderby" => $sort);
-
-?>
-]]>
-
-
-
- This method is for adding a top-level field to a query. It makes the query a
- subobject (if it isn't already) and adds the key/value pair of your chosing
- to the top level.
-
-
-
- It cannot be used to add extra criteria to a query on the fly. For instance,
- this will not work:
-
-find()->addOption("name", "joe")->addOption("age", 20);
-
-?>
-]]>
-
- This does not query for a user named "joe" with an age of 20.
-
-
-
-
-
- &reftitle.parameters;
-
-
-
-
- key
-
-
-
- Fieldname to add.
-
-
-
-
-
- value
-
-
-
- Value to add.
-
-
-
-
-
-
-
-
- &reftitle.returnvalues;
-
- Returns this cursor.
-
-
-
-
- &reftitle.errors;
-
- Throws MongoCursorException if this cursor has started iterating.
-
-
-
-
- &reftitle.examples;
-
- Adding a comment with MongoCursor::addOption example
-
- MongoDB supports special options to be send to the server. The shell uses
- the _addSpecial option to send a
- $comment to the server. This comment will show up in
- the profiling log (for slow queries f.e.). In the PHP driver, you use the
- MongoCursor::addOption method.
-
-
-demo->demo;
-$cursor = $c->find();
-$cursor->addOption('$comment', "This comment will show up in the profiling log");
-
-foreach ($cursor as $document) { /* empty */ }
-?>
-]]>
-
- &example.outputs.similar;
-
-
-
-
-
-
- MongoCursor::addOption example
-
- Using MongoCursor::skip to skip over millions of
- results can become slow. One way around this is to use
- $min or $max options for the query.
- These can be handy, but they require an index on exactly the fields being
- searched for. This is an example of how to use $min as
- an alternative to MongoCursor::skip.
-
-
-ensureIndex(array("ts" => 1));
-
-// you may have to modify this to run in a reasonable amount of time on slow
-// machines (should take about 30 seconds on a good machine)
-for ($i = 0; $i < 30000000; $i++) {
- $c->insert(array("ts" => new MongoDate(), "i" => $i));
-}
-
-$now = strtotime("now");
-
-// find documents inserted in the last 2 seconds
-$cursor = $c->find()->addOption('$min', array("ts" => $now-2));
-
-?>
-]]>
-
-
-
-
-
diff --git a/reference/mongo/mongocursor/awaitdata.xml b/reference/mongo/mongocursor/awaitdata.xml
deleted file mode 100644
index 4da87f908c..0000000000
--- a/reference/mongo/mongocursor/awaitdata.xml
+++ /dev/null
@@ -1,120 +0,0 @@
-
-
-
-
-
- MongoCursor::awaitData
- Sets whether this cursor will wait for a while for a tailable cursor to return more data
-
-
-
- &reftitle.description;
-
- publicMongoCursorMongoCursor::awaitData
- boolwait&true;
-
-
- This method is to be used with tailable cursors. If we are at the end of
- the data, block for a while rather than returning no data. After a timeout
- period, we do return as normal.
-
-
-
-
- &reftitle.parameters;
-
-
-
-
- wait
-
-
-
- If the cursor should wait for more data to become available.
-
-
-
-
-
-
-
-
- &reftitle.returnvalues;
-
- Returns this cursor.
-
-
-
-
- &reftitle.errors;
-
- Throws MongoCursorException if this cursor has started iterating.
-
-
-
-
- &reftitle.examples;
-
- MongoCursor::awaitData example
-
- In this example we tail the "oplog" and instead of sleeping during every
- iteration, we set the MongoCursor::awaitData option.
- MongoCursor::hasNext will now block until there is
- more data available.
-
-
- 'seta' ) );
-$c = $m->local->selectCollection( 'oplog.rs' );
-$cursor = $c->find( array( 'ns' => 'demo.article', 'op' => 'i' ) );
-$cursor->tailable( true );
-$cursor->awaitData( true );
-
-while (true) {
- if (!$cursor->hasNext()) {
- // we've read all the results, exit
- if ($cursor->dead()) {
- break;
- }
- } else {
- var_dump( $cursor->getNext() );
- }
-}
-?>
-]]>
-
-
-
-
-
- &reftitle.seealso;
-
- MongoDB core docs on tailable cursors.
-
-
-
- MongoCursor::tailable
-
-
-
-
-
diff --git a/reference/mongo/mongocursor/batchsize.xml b/reference/mongo/mongocursor/batchsize.xml
deleted file mode 100644
index b76f72275b..0000000000
--- a/reference/mongo/mongocursor/batchsize.xml
+++ /dev/null
@@ -1,186 +0,0 @@
-
-
-
-
-
- MongoCursor::batchSize
- Limits the number of elements returned in one batch
-
-
-
- &reftitle.description;
-
- publicMongoCursorMongoCursor::batchSize
- intbatchSize
-
-
- A cursor typically fetches a batch of result objects and store them
- locally. This method sets the batchSize value to configure the amount of
- documents retrieved from the server in one round trip. However, it will
- never return more documents than fit in the max batch size limit (usually
- 4MB).
-
-
-
-
- &reftitle.parameters;
-
-
-
-
- batchSize
-
-
-
- The number of results to return per batch. Each batch requires a
- round-trip to the server.
-
-
- If batchSize is 2 or
- more, it represents the size of each batch of objects retrieved.
- It can be adjusted to optimize performance and limit data transfer.
-
-
- If batchSize is 1 or negative, it
- will limit of number returned documents to the absolute value of batchSize,
- and the cursor will be closed. For example if
- batchSize is -10, then the server will return a maximum
- of 10 documents and as many as can fit in 4MB, then close the cursor.
-
-
-
- A batchSize of 1 is special, and
- means the same as -1, i.e. a value of
- 1 makes the cursor only capable of returning
- one document.
-
-
-
- Note that this feature is different from
- MongoCursor::limit in that documents must fit within a
- maximum size, and it removes the need to send a request to close the cursor
- server-side. The batch size can be changed even after a cursor is iterated,
- in which case the setting will apply on the next batch retrieval.
-
-
- This cannot override MongoDB's limit on the amount of data it will return to
- the client (i.e., if you set batch size to 1,000,000,000, MongoDB will still
- only return 4-16MB of results per batch).
-
-
- To ensure consistent behavior, the rules of
- MongoCursor::batchSize and
- MongoCursor::limit behave a
- little complex but work "as expected". The rules are: hard limits override
- soft limits with preference given to MongoCursor::limit
- over MongoCursor::batchSize. After that, whichever is
- set and lower than the other will take precedence. See below.
- section for some examples.
-
-
-
-
-
-
-
-
- &reftitle.returnvalues;
-
- Returns this cursor.
-
-
-
-
- &reftitle.examples;
-
- MongoCursor::batchSize and combinations with
- MongoCursor::limit
-
-limit(20)->batchSize(-10);
-
-// first batch: at most 10 items
-$cursor->limit(10);
-
-// first batch: at most 10 items
-$cursor->limit(10)->batchSize(20);
-
-// results are fetched in batches of 10 each, with a maximum of 20 items
-// returned (that means two batches of 10).
-$cursor->limit(20)->batchSize(10);
-
-// results are fetched in batches of 7 each, with a maximum of 30 items
-// returned (that means that the driver requests 4 batches of 7, and one batch
-// of 2).
-$cursor->limit(30)->batchSize(7)
-?>
-]]>
-
-
-
-
-
- &reftitle.seealso;
-
- MongoDB core docs on batchSize.
-
-
-
- MongoCursor::limit
- MongoCursorInterface::batchSize
-
-
-
-
-
- &reftitle.changelog;
-
-
-
-
-
- &Version;
- &Description;
-
-
-
-
- PECL mongo 1.4.5
-
-
- Before 1.4.5, this method would throw an
- MongoCursorException if the cursor had already
- started iterating.
-
-
-
-
-
-
-
-
-
-
-
diff --git a/reference/mongo/mongocursor/construct.xml b/reference/mongo/mongocursor/construct.xml
deleted file mode 100644
index 824b78dd83..0000000000
--- a/reference/mongo/mongocursor/construct.xml
+++ /dev/null
@@ -1,95 +0,0 @@
-
-
-
-
-
- MongoCursor::__construct
- Create a new cursor
-
-
-
- &reftitle.description;
-
- publicMongoCursor::__construct
- MongoClientconnection
- stringns
- arrayqueryarray()
- arrayfieldsarray()
-
-
-
-
- &reftitle.parameters;
-
-
-
-
- connection
-
-
-
- Database connection.
-
-
-
-
-
- ns
-
-
-
- Full name of database and collection.
-
-
-
-
-
- query
-
-
-
- Database query.
-
-
-
-
-
- fields
-
-
-
- Fields to return.
-
-
-
-
-
-
-
-
- &reftitle.returnvalues;
-
- Returns the new cursor.
-
-
-
-
-
diff --git a/reference/mongo/mongocursor/count.xml b/reference/mongo/mongocursor/count.xml
deleted file mode 100644
index ba7ab30d89..0000000000
--- a/reference/mongo/mongocursor/count.xml
+++ /dev/null
@@ -1,110 +0,0 @@
-
-
-
-
-
- MongoCursor::count
- Counts the number of results for this query
-
-
-
- &reftitle.description;
-
- publicintMongoCursor::count
- boolfoundOnly&false;
-
-
- This method does not affect the state of the cursor: if you haven't queried
- yet, you can still apply limits, skips, etc. If you have started iterating
- through results, it will not move the current position of the cursor. If you
- have exhausted the cursor, it will not reset it.
-
-
-
-
- &reftitle.parameters;
-
-
-
- foundOnly
-
-
-
- Send cursor limit and skip information to the count function, if applicable.
-
-
-
-
-
-
-
- &reftitle.returnvalues;
-
- The number of documents returned by this cursor's query.
-
-
-
-
- &reftitle.examples;
-
- MongoCursor::count example
-
-insert(array('x'=>1));
-$collection->insert(array('x'=>2));
-$collection->insert(array('x'=>3));
-
-$cursor = $collection->find();
-
-var_dump($cursor->count());
-var_dump($cursor->count(true));
-
-$cursor->limit(2);
-
-var_dump($cursor->count());
-var_dump($cursor->count(true));
-
-?>
-]]>
-
- &example.outputs.similar;
-
-
-
-
-
-
-
- &reftitle.errors;
-
- Throws MongoConnectionException if it cannot reach the
- database.
-
-
-
-
diff --git a/reference/mongo/mongocursor/current.xml b/reference/mongo/mongocursor/current.xml
deleted file mode 100644
index 940f29d574..0000000000
--- a/reference/mongo/mongocursor/current.xml
+++ /dev/null
@@ -1,59 +0,0 @@
-
-
-
-
-
- MongoCursor::current
- Returns the current element
-
-
-
- &reftitle.description;
-
- publicarrayMongoCursor::current
-
-
-
- This returns &null; until MongoCursor::next is called.
-
-
-
-
- &reftitle.parameters;
- &no.function.parameters;
-
-
-
- &reftitle.returnvalues;
-
- The current result document as an associative array. &null; will be returned
- if there is no result.
-
-
-
-
- &reftitle.seealso;
-
- Iterator::current
-
-
-
-
diff --git a/reference/mongo/mongocursor/dead.xml b/reference/mongo/mongocursor/dead.xml
deleted file mode 100644
index 3889fabd13..0000000000
--- a/reference/mongo/mongocursor/dead.xml
+++ /dev/null
@@ -1,68 +0,0 @@
-
-
-
-
-
- MongoCursor::dead
- Checks if there are results that have not yet been sent from the database
-
-
-
- &reftitle.description;
-
- publicboolMongoCursor::dead
-
-
-
- The database sends responses in batches of documents, up to 4MB of documents
- per response. This method checks if the database has more batches or if the
- result set has been exhausted.
-
-
- A cursor being "dead" does not mean that
- MongoCursor::hasNext will return &false;, it only means
- that the database is done sending results to the client. The client should
- continue iterating through results until
- MongoCursor::hasNext is &false;.
-
-
-
-
- &reftitle.parameters;
- &no.function.parameters;
-
-
-
- &reftitle.returnvalues;
-
- Returns &true; if there are more results that have not yet been sent to the
- client, and &false; otherwise.
-
-
-
-
- &reftitle.seealso;
-
- MongoCursorInterface::dead
-
-
-
-
diff --git a/reference/mongo/mongocursor/doquery.xml b/reference/mongo/mongocursor/doquery.xml
deleted file mode 100644
index c00789adb2..0000000000
--- a/reference/mongo/mongocursor/doquery.xml
+++ /dev/null
@@ -1,130 +0,0 @@
-
-
-
-
-
- MongoCursor::doQuery
- Execute the query
-
-
-
- &reftitle.description;
-
- protectedvoidMongoCursor::doQuery
-
-
-
-
- Please do not use me.
-
-
-
- This function actually queries the database. All queries and commands go
- through this function. Thus, this function can be overridden to provide
- custom query handling.
-
-
- This handles serializing your query, sending it to the database, receiving a
- response, and deserializing it. Thus, if you are planning to override this,
- your code should probably call out to the original to use the existing
- functionality (see the example below).
-
-
-
-
- &reftitle.parameters;
- &no.function.parameters;
-
-
-
- &reftitle.returnvalues;
-
- &null;.
-
-
-
-
- &reftitle.errors;
-
- Throws MongoConnectionException if it cannot reach the
- database.
-
-
-
-
- &reftitle.changelog;
-
-
-
-
-
- &Version;
- &Description;
-
-
-
-
- PECL mongo 1.2.11
- Emits E_DEPRECATED when used.
-
-
-
-
-
-
-
-
- &reftitle.examples;
-
-
- MongoCursor::doQuery example
-
- You could override this function to attempt a query on a secondary and, if
- that fails, try it again on the primary.
-
-
-slaveOkay();
-
- try {
- MongoCursor::doQuery();
- }
- catch(MongoCursorException $e) {
- $this->slaveOkay(false);
- MongoCursor::doQuery();
- }
- }
-}
-
-?>
-]]>
-
-
-
-
-
-
diff --git a/reference/mongo/mongocursor/explain.xml b/reference/mongo/mongocursor/explain.xml
deleted file mode 100644
index 253bf10f17..0000000000
--- a/reference/mongo/mongocursor/explain.xml
+++ /dev/null
@@ -1,137 +0,0 @@
-
-
-
-
-
- MongoCursor::explain
- Return an explanation of the query, often useful for optimization and debugging
-
-
-
- &reftitle.description;
-
- publicarrayMongoCursor::explain
-
-
-
-
-
- &reftitle.parameters;
- &no.function.parameters;
-
-
-
- &reftitle.returnvalues;
-
- Returns an explanation of the query.
-
-
-
- &reftitle.examples;
-
- MongoCursor::explain example
-
-find(array("x"=>1), array("y"));
-$cursor->sort(array("z" => 1))->limit(4)->skip(5);
-
-var_dump($cursor->explain());
-
-?>
-]]>
-
- &example.outputs.similar;
-
-
- string(15) "BtreeCursor x_1"
- ["startKey"]=>
- array(1) {
- ["x"]=>
- int(1)
- }
- ["endKey"]=>
- array(1) {
- ["x"]=>
- int(1)
- }
- ["nscanned"]=>
- float(4)
- ["n"]=>
- int(4)
- ["scanAndOrder"]=>
- int(1)
- ["millis"]=>
- int(3)
- ["allPlans"]=>
- array(2) {
- [0]=>
- array(3) {
- ["cursor"]=>
- string(15) "BtreeCursor x_1"
- ["startKey"]=>
- array(1) {
- ["x"]=>
- int(1)
- }
- ["endKey"]=>
- array(1) {
- ["x"]=>
- int(1)
- }
- }
- [1]=>
- array(3) {
- ["cursor"]=>
- string(11) "BasicCursor"
- ["startKey"]=>
- array(0) {
- }
- ["endKey"]=>
- array(0) {
- }
- }
- }
-}
-]]>
-
-
-
-
- &reftitle.errors;
-
- Throws MongoConnectionException if it cannot reach the
- database.
-
-
-
-
- &reftitle.seealso;
-
- MongoDB core docs on explain.
-
-
-
-
-
diff --git a/reference/mongo/mongocursor/fields.xml b/reference/mongo/mongocursor/fields.xml
deleted file mode 100644
index 77e0034c6b..0000000000
--- a/reference/mongo/mongocursor/fields.xml
+++ /dev/null
@@ -1,98 +0,0 @@
-
-
-
-
-
- MongoCursor::fields
- Sets the fields for a query
-
-
-
- &reftitle.description;
-
- publicMongoCursorMongoCursor::fields
- arrayf
-
-
- Fields are specified by "fieldname" : bool. &true;
- indicates that a field should be returned, &false; indicates that it should
- not be returned. You can also use 1 and 0 instead of &true; and &false;.
-
-
- Thus, to return only the "summary" field, one could say:
-
-
-fields(array("summary" => true));
-
-?>
-]]>
-
-
- To return all fields except the "hidden" field:
-
-
-fields(array("hidden" => false));
-
-?>
-]]>
-
-
-
-
- &reftitle.parameters;
-
-
-
-
- f
-
-
-
- Fields to return (or not return).
-
-
-
-
-
-
-
-
- &reftitle.returnvalues;
-
- Returns this cursor.
-
-
-
-
- &reftitle.errors;
-
- Throws MongoCursorException if this cursor has started
- iterating or a scalar argument is given.
-
-
-
-
diff --git a/reference/mongo/mongocursor/getnext.xml b/reference/mongo/mongocursor/getnext.xml
deleted file mode 100644
index ba470bd0ec..0000000000
--- a/reference/mongo/mongocursor/getnext.xml
+++ /dev/null
@@ -1,42 +0,0 @@
-
-
-
-
-
- MongoCursor::getNext
- Advances the cursor to the next result, and returns that result
-
-
-
- &reftitle.description;
-
- publicarrayMongoCursor::getNext
-
-
-
-
-
- MongoCursor::getNext is an alias of MongoCursor::next.
-
-
-
-
-
diff --git a/reference/mongo/mongocursor/getreadpreference.xml b/reference/mongo/mongocursor/getreadpreference.xml
deleted file mode 100644
index 2373dca64d..0000000000
--- a/reference/mongo/mongocursor/getreadpreference.xml
+++ /dev/null
@@ -1,107 +0,0 @@
-
-
-
-
-
- MongoCursor::getReadPreference
- Get the read preference for this query
-
-
-
- &reftitle.description;
-
- publicarrayMongoCursor::getReadPreference
-
-
-
-
-
- &reftitle.parameters;
- &no.function.parameters;
-
-
-
- &reftitle.returnvalues;
- &mongo.getreadpreference.returnvalues;
-
-
-
- &reftitle.examples;
-
- MongoCursor::getReadPreference return value example
-
-test->users->find();
-$cursor->setReadPreference(MongoClient::RP_SECONDARY, array(
- array('dc' => 'east', 'use' => 'reporting'),
- array('dc' => 'west'),
- array(),
-));
-var_dump($cursor->getReadPreference());
-?>
-]]>
-
- &example.outputs;
-
-
- string(9) "secondary"
- ["tagsets"]=>
- array(3) {
- [0]=>
- array(2) {
- ["dc"]=>
- string(4) "east"
- ["use"]=>
- string(9) "reporting"
- }
- [1]=>
- array(1) {
- ["dc"]=>
- string(7) "west"
- }
- [2]=>
- array(0) {
- }
- }
-}
-]]>
-
-
-
-
-
- &reftitle.seealso;
-
- The read preferences documentation.
- MongoCursor::setReadPreference
- MongoCursorInterface::getReadPreference
-
-
-
-
-
-
diff --git a/reference/mongo/mongocursor/hasnext.xml b/reference/mongo/mongocursor/hasnext.xml
deleted file mode 100644
index 7194f454b9..0000000000
--- a/reference/mongo/mongocursor/hasnext.xml
+++ /dev/null
@@ -1,57 +0,0 @@
-
-
-
-
-
- MongoCursor::hasNext
- Checks if there are any more elements in this cursor
-
-
-
- &reftitle.description;
-
- publicboolMongoCursor::hasNext
-
-
-
-
-
- &reftitle.parameters;
- &no.function.parameters;
-
-
-
- &reftitle.returnvalues;
-
- Returns if there is another element.
-
-
-
-
- &reftitle.errors;
-
- Throws MongoConnectionException if it cannot reach
- the database and MongoCursorTimeoutException if the
- timeout is exceeded.
-
-
-
-
diff --git a/reference/mongo/mongocursor/hint.xml b/reference/mongo/mongocursor/hint.xml
deleted file mode 100644
index 6081f6322b..0000000000
--- a/reference/mongo/mongocursor/hint.xml
+++ /dev/null
@@ -1,99 +0,0 @@
-
-
-
-
-
- MongoCursor::hint
- Gives the database a hint about the query
-
-
-
- &reftitle.description;
-
- publicMongoCursorMongoCursor::hint
- mixedindex
-
-
-
-
- &reftitle.parameters;
-
-
-
-
- index
-
-
-
- Index to use for the query. If a string is passed, it should correspond
- to an index name. If an array or object is passed, it should correspond
- to the specification used to create the index (i.e. the first argument
- to MongoCollection::ensureIndex).
-
-
-
-
-
-
-
-
- &reftitle.returnvalues;
-
- Returns this cursor.
-
-
-
-
- &reftitle.errors;
-
- Throws MongoCursorException if this cursor has started iterating.
-
-
-
-
- &reftitle.changelog;
-
-
-
-
-
- &Version;
- &Description;
-
-
-
-
- PECL mongo 1.4.0
-
-
- The index argument now supports index names as
- string values. In versions before 1.4.0, only array or object values
- were accepted.
-
-
-
-
-
-
-
-
-
-
diff --git a/reference/mongo/mongocursor/immortal.xml b/reference/mongo/mongocursor/immortal.xml
deleted file mode 100644
index c3773fc1f1..0000000000
--- a/reference/mongo/mongocursor/immortal.xml
+++ /dev/null
@@ -1,85 +0,0 @@
-
-
-
-
-
- MongoCursor::immortal
- Sets whether this cursor will timeout
-
-
-
- &reftitle.description;
-
- publicMongoCursorMongoCursor::immortal
- boolliveForever&true;
-
-
- After remaining idle on the server for some amount of time, cursors, by
- default, "die." This is generally the behavior one wants. The database
- cleans up a cursor once all of its results have been sent to the client,
- but if the client doesn't request all of the results, the cursor will
- languish there, taking up resources. Thus, after a few minutes, the cursor
- "times out" and the database assumes the client has gotten everything it
- needs and cleans up its the cursor's resources.
-
-
- If, for some reason, you need a cursor to hang around for a long time, you
- can prevent the database from cleaning it up by using this method.
- However, if you make a cursor immortal, you need to iterate through all of
- its results (or at least until MongoCursor::dead
- returns &true;) or the cursor will hang around the database
- forever, taking up resources.
-
-
-
-
- &reftitle.parameters;
-
-
-
-
- liveForever
-
-
-
- If the cursor should be immortal.
-
-
-
-
-
-
-
-
- &reftitle.returnvalues;
-
- Returns this cursor.
-
-
-
-
- &reftitle.errors;
-
- Throws MongoCursorException if this cursor has started iterating.
-
-
-
-
diff --git a/reference/mongo/mongocursor/info.xml b/reference/mongo/mongocursor/info.xml
deleted file mode 100644
index d9b427ed58..0000000000
--- a/reference/mongo/mongocursor/info.xml
+++ /dev/null
@@ -1,191 +0,0 @@
-
-
-
-
-
- MongoCursor::info
- Gets information about the cursor's creation and iteration
-
-
-
- &reftitle.description;
-
- publicarrayMongoCursor::info
-
-
-
- This can be called before or after the cursor has started iterating.
-
-
-
-
- &reftitle.parameters;
- &no.function.parameters;
-
-
-
- &reftitle.returnvalues;
-
- Returns the namespace, batch size, limit, skip, flags, query, and projected
- fields for this cursor. If the cursor has started iterating, additional
- information about iteration and the connection will be included.
-
-
-
-
- &reftitle.changelog;
-
-
-
-
-
- &Version;
- &Description;
-
-
-
-
- PECL mongo 1.1.0
-
- Added a number of other fields, including id (the
- cursor id), at (the driver's counter of which
- document is current), numReturned (the number
- returned by the server in the current batch), and
- server (which server the query was sent
- to—useful in conjunction with
- .
-
-
-
- PECL mongo 1.0.10
-
- Added started_iterating field, a boolean indicating
- if cursor is pre- or post-query.
-
-
-
-
-
-
-
-
-
- &reftitle.examples;
-
- MongoCursor::info example
-
-test->foo->find(array("x" => 4), array("y" => 0));
-
-echo "Before iteration started:\n";
-var_dump($cursor->info());
-
-echo "\nAfter iteration started:\n";
-$cursor->rewind();
-var_dump($cursor->info());
-
-?>
-]]>
-
- &example.outputs.similar;
-
-
- string(8) "test.foo"
- ["limit"]=>
- int(0)
- ["batchSize"]=>
- int(0)
- ["skip"]=>
- int(0)
- ["flags"]=>
- int(0)
- ["query"]=>
- array(1) {
- ["x"]=>
- int(4)
- }
- ["fields"]=>
- array(1) {
- ["y"]=>
- int(0)
- }
- ["started_iterating"]=>
- bool(false)
-}
-
-After iteration started:
-array(15) {
- ["ns"]=>
- string(8) "test.foo"
- ["limit"]=>
- int(0)
- ["batchSize"]=>
- int(0)
- ["skip"]=>
- int(0)
- ["flags"]=>
- int(0)
- ["query"]=>
- array(1) {
- ["x"]=>
- int(4)
- }
- ["fields"]=>
- array(1) {
- ["y"]=>
- int(0)
- }
- ["started_iterating"]=>
- bool(true)
- ["id"]=>
- int(0)
- ["at"]=>
- int(0)
- ["numReturned"]=>
- int(1)
- ["server"]=>
- string(25) "localhost:27017;-;.;26450"
- ["host"]=>
- string(9) "localhost"
- ["port"]=>
- int(27017)
- ["connection_type_desc"]=>
- string(10) "STANDALONE"
-}
-]]>
-
-
-
-
-
- &reftitle.seealso;
-
- MongoCursorInterface::info
-
-
-
-
diff --git a/reference/mongo/mongocursor/key.xml b/reference/mongo/mongocursor/key.xml
deleted file mode 100644
index 952af7c4c0..0000000000
--- a/reference/mongo/mongocursor/key.xml
+++ /dev/null
@@ -1,57 +0,0 @@
-
-
-
-
-
- MongoCursor::key
- Returns the current result's _id, or its index within the result set
-
-
-
- &reftitle.description;
-
- publicstringintMongoCursor::key
-
-
-
-
-
- &reftitle.parameters;
- &no.function.parameters;
-
-
-
- &reftitle.returnvalues;
-
- The current result's _id as a string. If the result
- has no _id, its numeric index within the result set will
- be returned as an integer.
-
-
-
-
- &reftitle.seealso;
-
- Iterator::key
-
-
-
-
diff --git a/reference/mongo/mongocursor/limit.xml b/reference/mongo/mongocursor/limit.xml
deleted file mode 100644
index ac52c8a97b..0000000000
--- a/reference/mongo/mongocursor/limit.xml
+++ /dev/null
@@ -1,79 +0,0 @@
-
-
-
-
-
- MongoCursor::limit
- Limits the number of results returned
-
-
-
- &reftitle.description;
-
- publicMongoCursorMongoCursor::limit
- intnum
-
-
-
-
- &reftitle.parameters;
-
-
-
-
- num
-
-
-
- The number of results to return.
-
-
-
-
-
-
-
-
- &reftitle.returnvalues;
-
- Returns this cursor.
-
-
-
-
- &reftitle.errors;
-
- Throws MongoCursorException if this cursor has started iterating.
-
-
-
-
- &reftitle.seealso;
-
-
- MongoDB core docs on limit.
- MongoCursor::batchSize
- MongoCursor::skip
-
-
-
-
-
diff --git a/reference/mongo/mongocursor/maxtimems.xml b/reference/mongo/mongocursor/maxtimems.xml
deleted file mode 100644
index 91b9b99dca..0000000000
--- a/reference/mongo/mongocursor/maxtimems.xml
+++ /dev/null
@@ -1,119 +0,0 @@
-
-
-
-
-
- MongoCursor::maxTimeMS
- Sets a server-side timeout for this query
-
-
-
- &reftitle.description;
-
- publicMongoCursorMongoCursor::maxTimeMS
- intms
-
-
- Specifies a cumulative time limit in milliseconds to be allowed by the server
- for processing operations on the cursor.
-
-
-
-
- &reftitle.parameters;
-
-
-
- ms
-
-
-
- Specifies a cumulative time limit in milliseconds to be allowed by the
- server for processing operations on the cursor.
-
-
-
-
-
-
-
- &reftitle.returnvalues;
-
- This cursor.
-
-
-
-
- &reftitle.errors;
-
- Throws MongoCursorException if this cursor has started
- iterating.
-
-
- Causes methods that fetch results to throw a
- MongoExecutionTimeoutException if the query takes
- longer than the specified number of milliseconds in processing time.
-
-
-
-
- &reftitle.examples;
-
- MongoCursor::maxTimeMS example
-
- In the following example, the server will abort the query if the cursor
- requires more than two seconds in processing time to return its results.
-
-
-find();
-$cursor->maxTimeMS(2000);
-
-try {
- $results = iterator_to_array($cursor);
-} catch (MongoExecutionTimeoutException $e) {
- echo "query took too long!";
-}
-
-?>
-]]>
-
-
-
-
-
- &reftitle.notes;
-
-
- Unlike MongoCursor::timeout, which specifies a
- client-side timeout, MongoCursor::maxTimeMS can be
- used to cause the MongoDB server to abort long-running queries. This
- timeout is cumulative for the lifetime of the cursor (i.e. each batch will
- contribute to this time limit). The timeout only considers processing time;
- idle time is not considered.
-
-
-
-
-
-
diff --git a/reference/mongo/mongocursor/next.xml b/reference/mongo/mongocursor/next.xml
deleted file mode 100644
index 8b9fb049e1..0000000000
--- a/reference/mongo/mongocursor/next.xml
+++ /dev/null
@@ -1,64 +0,0 @@
-
-
-
-
-
- MongoCursor::next
- Advances the cursor to the next result, and returns that result
-
-
-
- &reftitle.description;
-
- publicarrayMongoCursor::next
-
-
-
-
-
- &reftitle.parameters;
- &no.function.parameters;
-
-
-
- &reftitle.returnvalues;
-
- Returns the next document.
-
-
-
-
- &reftitle.errors;
-
- Throws MongoConnectionException if it cannot reach the
- database and MongoCursorTimeoutException if the
- timeout is exceeded.
-
-
-
-
- &reftitle.seealso;
-
- Iterator::next
-
-
-
-
diff --git a/reference/mongo/mongocursor/partial.xml b/reference/mongo/mongocursor/partial.xml
deleted file mode 100644
index 7d78e7496d..0000000000
--- a/reference/mongo/mongocursor/partial.xml
+++ /dev/null
@@ -1,87 +0,0 @@
-
-
-
-
-
- MongoCursor::partial
- If this query should fetch partial results from mongos if a shard is down
-
-
-
- &reftitle.description;
-
- publicMongoCursorMongoCursor::partial
- boolokay&true;
-
-
- This option allows mongos to send partial query results
- if a shard is unreachable. This is only applicable when running a sharded
- MongoDB cluster and connecting to a mongos.
-
-
- If a shard goes down and a query needs to be sent to that shard,
- mongos will return the results (if any) from shards it
- already contacted, then an error message that it could not reach the shard
- (a MongoCursorException in PHP). If you would like to
- get whatever results mongos can provide and no
- exception, you can use this method. Note that this means that you won't have
- an indication that a shard is down in your query response.
-
-
- This has no effect on the query if all shards are reachable. This flag was
- implemented in MongoDB version 1.7.5, so will only work with that version and
- higher.
-
-
-
-
- &reftitle.parameters;
-
-
-
-
- okay
-
-
-
- If receiving partial results is okay.
-
-
-
-
-
-
-
-
- &reftitle.returnvalues;
-
- Returns this cursor.
-
-
-
-
- &reftitle.errors;
-
- Throws MongoCursorException if this cursor has started iterating.
-
-
-
-
diff --git a/reference/mongo/mongocursor/reset.xml b/reference/mongo/mongocursor/reset.xml
deleted file mode 100644
index 21bb9d1fd9..0000000000
--- a/reference/mongo/mongocursor/reset.xml
+++ /dev/null
@@ -1,48 +0,0 @@
-
-
-
-
-
- MongoCursor::reset
- Clears the cursor
-
-
-
- &reftitle.description;
-
- publicvoidMongoCursor::reset
-
-
-
-
-
- &reftitle.parameters;
- &no.function.parameters;
-
-
-
- &reftitle.returnvalues;
-
- &null;.
-
-
-
-
diff --git a/reference/mongo/mongocursor/rewind.xml b/reference/mongo/mongocursor/rewind.xml
deleted file mode 100644
index 3cc6e56aea..0000000000
--- a/reference/mongo/mongocursor/rewind.xml
+++ /dev/null
@@ -1,79 +0,0 @@
-
-
-
-
-
- MongoCursor::rewind
- Returns the cursor to the beginning of the result set
-
-
-
- &reftitle.description;
-
- publicvoidMongoCursor::rewind
-
-
-
- This is identical to the function:
-
-
-reset();
- $this->next();
-}
-
-?>
-]]>
-
-
-
-
- &reftitle.parameters;
- &no.function.parameters;
-
-
-
- &reftitle.returnvalues;
-
- &null;.
-
-
-
-
- &reftitle.errors;
-
- Throws MongoConnectionException if it cannot reach the
- database and MongoCursorTimeoutException if the
- timeout is exceeded.
-
-
-
-
- &reftitle.seealso;
-
- Iterator::rewind
-
-
-
-
diff --git a/reference/mongo/mongocursor/setflag.xml b/reference/mongo/mongocursor/setflag.xml
deleted file mode 100644
index 7592e1b461..0000000000
--- a/reference/mongo/mongocursor/setflag.xml
+++ /dev/null
@@ -1,145 +0,0 @@
-
-
-
-
-
- MongoCursor::setFlag
- Sets arbitrary flags in case there is no method available the specific flag
-
-
-
- &reftitle.description;
-
- publicMongoCursorMongoCursor::setFlag
- intflag
- boolset&true;
-
-
- The MongoCursor class has several methods for
- setting flags on the query object. This method is available in case the
- MongoDB wire protocol has acquired a new flag, and the driver has not been
- updated with a method for this new flag. In all other cases, the method
- should be used. See the "See also" section for available methods.
-
-
-
-
- &reftitle.parameters;
-
-
-
-
- flag
-
-
-
- Which flag to set. You can not set flag 6 (EXHAUST) as the driver does
- not know how to handle them. You will get a warning if you try to use
- this flag. For available flags, please refer to the wire protocol
- documentation.
-
-
-
-
-
- set
-
-
-
- Whether the flag should be set (&true;) or unset (&false;).
-
-
-
-
-
-
-
-
- &reftitle.returnvalues;
-
- Returns this cursor.
-
-
-
-
- &reftitle.errors;
-
- Shows a warning when an unsupport flag is attempted to be set.
-
-
-
-
- &reftitle.changelog;
-
-
-
-
-
- &Version;
- &Description;
-
-
-
-
- PECL mongo 1.4.0
-
- Support for flag 3 (OPLOG_REPLAY) is added. Versions before 1.4.0
- would throw a warning saying that the flag is unsupported.
-
-
-
-
-
-
-
-
-
- &reftitle.examples;
-
- MongoCursor::setFlag example
-
- 'seta' ) );
-$c = $m->local->selectCollection( 'oplog.rs' );
-$cursor = $c->find( array( 'ns' => 'demo.article', 'op' => 'i' ) );
-$cursor->setFlag( 1, true ); // sets the tailable flag
-$cursor->setFlag( 5, true ); // sets the await data flag
-?>
-]]>
-
-
-
-
-
- &reftitle.seealso;
-
-
- MongoCursor::tailable
- MongoCursor::immortal
- MongoCursor::awaitData
- MongoCursor::partial
- MongoDB core docs onwire protocol query flags
-
-
-
-
-
diff --git a/reference/mongo/mongocursor/setreadpreference.xml b/reference/mongo/mongocursor/setreadpreference.xml
deleted file mode 100644
index ca5928b2e9..0000000000
--- a/reference/mongo/mongocursor/setreadpreference.xml
+++ /dev/null
@@ -1,90 +0,0 @@
-
-
-
-
-
- MongoCursor::setReadPreference
- Set the read preference for this query
-
-
-
- &reftitle.description;
-
- publicMongoCursorMongoCursor::setReadPreference
- stringread_preference
- arraytags
-
-
-
-
- &reftitle.parameters;
- &mongo.setreadpreference.parameters;
-
-
-
- &reftitle.returnvalues;
-
- Returns this cursor.
-
-
-
-
- &reftitle.errors;
- &mongo.setreadpreference.errors;
-
-
-
- &reftitle.examples;
-
- MongoCursor::setReadPreference tag set array syntax example
-
-
-test->users->find();
-
-// Prefer the nearest server in the "east" data center also used for reporting,
-// but fall back to a server in the "west" data center
-$cursor->setReadPreference(MongoClient::RP_NEAREST, array(
- array('dc' => 'east', 'use' => 'reporting'),
- array('dc' => 'west'),
-));
-?>
-]]>
-
-
-
-
-
- &reftitle.seealso;
-
- The read preferences documentation.
- MongoCursor::getReadPreference
- MongoCursorInterface::setReadPreference
-
-
-
-
-
-
diff --git a/reference/mongo/mongocursor/skip.xml b/reference/mongo/mongocursor/skip.xml
deleted file mode 100644
index c5d007f6d7..0000000000
--- a/reference/mongo/mongocursor/skip.xml
+++ /dev/null
@@ -1,78 +0,0 @@
-
-
-
-
-
- MongoCursor::skip
- Skips a number of results
-
-
-
- &reftitle.description;
-
- publicMongoCursorMongoCursor::skip
- intnum
-
-
-
-
- &reftitle.parameters;
-
-
-
-
- num
-
-
-
- The number of results to skip.
-
-
-
-
-
-
-
-
- &reftitle.returnvalues;
-
- Returns this cursor.
-
-
-
-
- &reftitle.errors;
-
- Throws MongoCursorException if this cursor has started iterating.
-
-
-
-
- &reftitle.seealso;
-
-
- MongoCursor::limit
-
-
-
-
-
-
diff --git a/reference/mongo/mongocursor/slaveokay.xml b/reference/mongo/mongocursor/slaveokay.xml
deleted file mode 100644
index fc83f237a1..0000000000
--- a/reference/mongo/mongocursor/slaveokay.xml
+++ /dev/null
@@ -1,180 +0,0 @@
-
-
-
-
-
- MongoCursor::slaveOkay
- Sets whether this query can be done on a secondary [deprecated]
-
-
-
- &reftitle.description;
-
- publicMongoCursorMongoCursor::slaveOkay
- boolokay&true;
-
-
-
- This method is deprecated since version 1.5.0. Instead, please use
- MongoCursor::setReadPreference and .
-
-
-
- Calling this will make the driver route reads to secondaries if:
-
-
-
- You are using a replica set, and
-
-
-
-
- You created a MongoClient instance using the option
- "replicaSet" => "setName", and
-
-
-
-
- There is a healthy secondary that can be reached by the driver.
-
-
-
- You can check which server was used for this query by calling
- MongoCursor::info after running the query. It's
- server field will show which server the query was sent to.
-
-
- Note that you should use this function even if you do not use the automatic
- routing to secondaries. If you connect directly to a secondary in a replica
- set, you still need to call this function, which basically tells the database
- that you are aware that you might be getting older data and you're okay with
- that. If you do not call this, you'll get "not master" errors when you try to
- query.
-
-
- This method will override the static class variable
- MongoCursor::$slaveOkay. It will also override
- Mongo::setSlaveOkay,
- MongoDB::setSlaveOkay and
- MongoCollection::setSlaveOkay.
-
-
-
-
- &reftitle.parameters;
-
-
-
-
- okay
-
-
-
- If it is okay to query the secondary.
-
-
-
-
-
-
-
-
- &reftitle.returnvalues;
-
- Returns this cursor.
-
-
-
-
- &reftitle.errors;
-
- Throws MongoCursorException if this cursor has started iterating.
-
-
-
-
- &reftitle.examples;
-
- MongoCursor::slaveOkay example
-
-find();
-
-// can query secondary
-$cursor = $collection->find()->slaveOkay();
-
-MongoCursor::$slaveOkay = true;
-
-// can query secondary
-$cursor = $collection->find();
-
-// cannot query secondary
-$cursor = $collection->find()->slaveOkay(false);
-
-?>
-]]>
-
-
-
-
-
- &reftitle.seealso;
-
-
- MongoCursor::setReadPreference
- MongoCursor::getReadPreference
-
-
-
-
- &reftitle.changelog;
-
-
-
-
-
- &Version;
- &Description;
-
-
-
-
- PECL mongo 1.5.0
-
- This method has been deprecated in favour of
- MongoCursor::setReadPreference and .
-
-
-
-
-
-
-
-
-
-
diff --git a/reference/mongo/mongocursor/snapshot.xml b/reference/mongo/mongocursor/snapshot.xml
deleted file mode 100644
index bb9854307e..0000000000
--- a/reference/mongo/mongocursor/snapshot.xml
+++ /dev/null
@@ -1,76 +0,0 @@
-
-
-
-
-
- MongoCursor::snapshot
- Use snapshot mode for the query
-
-
-
- &reftitle.description;
-
- publicMongoCursorMongoCursor::snapshot
-
-
-
- Use snapshot mode for the query. Snapshot mode ensures that a document will
- not be returned more than once because an intervening write operation results
- in a move of the document. Documents inserted or deleted during the lifetime
- of the cursor may or may not be returned, irrespective of snapshot mode.
-
-
- Queries with short responses (less than 1MB) are always effectively
- snapshotted.
-
-
- Snapshot mode may not be used with sorting, explicit hints, or queries on
- sharded collections.
-
-
-
-
- &reftitle.parameters;
- &no.function.parameters;
-
-
-
- &reftitle.returnvalues;
-
- Returns this cursor.
-
-
-
-
- &reftitle.errors;
-
- Throws MongoCursorException if this cursor has started iterating.
-
-
-
-
- &reftitle.seealso;
-
- MongoDB core docs on $snapshot operator.
-
-
-
-
diff --git a/reference/mongo/mongocursor/sort.xml b/reference/mongo/mongocursor/sort.xml
deleted file mode 100644
index fda21fb335..0000000000
--- a/reference/mongo/mongocursor/sort.xml
+++ /dev/null
@@ -1,101 +0,0 @@
-
-
-
-
-
- MongoCursor::sort
- Sorts the results by given fields
-
-
-
- &reftitle.description;
-
- publicMongoCursorMongoCursor::sort
- arrayfields
-
-
-
-
- &reftitle.parameters;
-
-
-
-
- fields
-
-
-
- An array of fields by which to sort. Each element in the array has as
- key the field name, and as value either 1 for
- ascending sort, or -1 for descending sort.
-
-
- Each result is first sorted on the first field in the array, then (if
- it exists) on the second field in the array, etc. This means that the
- order of the fields in the fields array is
- important. See also the examples section.
-
-
-
-
-
-
-
-
- &reftitle.returnvalues;
-
- Returns the same cursor that this method was called on.
-
-
-
-
- &reftitle.errors;
-
- Throws MongoCursorException if this cursor has started iterating.
-
-
-
-
- &reftitle.examples;
-
- MongoCursor::sort example
-
-sort(array('x' => 1));
-
-// The order in the associative array is important. For instance, these two
-// examples will yield different results:
-
-// Sort on date ascending and age descending
-$cursor->sort(array('date' => 1, 'age' => -1));
-
-// Sort on age descending and date ascending
-$cursor->sort(array('age' => -1, 'date' => 1));
-?>
-]]>
-
-
-
-
-
-
diff --git a/reference/mongo/mongocursor/tailable.xml b/reference/mongo/mongocursor/tailable.xml
deleted file mode 100644
index 5ece23827d..0000000000
--- a/reference/mongo/mongocursor/tailable.xml
+++ /dev/null
@@ -1,126 +0,0 @@
-
-
-
-
-
- MongoCursor::tailable
- Sets whether this cursor will be left open after fetching the last results
-
-
-
- &reftitle.description;
-
- publicMongoCursorMongoCursor::tailable
- booltail&true;
-
-
- Mongo has a feature known as tailable cursors which are similar to the Unix
- "tail -f" command.
-
-
- Tailable means cursor is not closed when the last data is retrieved. Rather,
- the cursor marks the final object's position. you can resume using the
- cursor later, from where it was located, if more data were received.
-
-
- Like any "latent cursor", the cursor may become invalid at some point -- for
- example if that final object it references were deleted. Thus, you should be
- prepared to requery if the cursor is MongoCursor::dead.
-
-
-
-
- &reftitle.parameters;
-
-
-
-
- tail
-
-
-
- If the cursor should be tailable.
-
-
-
-
-
-
-
-
- &reftitle.returnvalues;
-
- Returns this cursor.
-
-
-
-
- &reftitle.errors;
-
- Throws MongoCursorException if this cursor has started iterating.
-
-
-
-
- &reftitle.examples;
-
- MongoCursor::tailable example
-
-find()->tailable();
-
-$results = array();
-
-while (1) {
- if (!$cursor->hasNext()) {
- // we've read all the results, exit
- if ($cursor->dead()) {
- break;
- }
- // read all results so far, wait for more
- sleep(10);
- }
- else {
- $results[] = $cursor->getNext();
- }
-}
-
-?>
-]]>
-
-
-
-
-
- &reftitle.seealso;
-
- MongoDB core docs on tailable cursors.
-
-
-
- MongoCursor::awaitData
-
-
-
-
-
diff --git a/reference/mongo/mongocursor/timeout.xml b/reference/mongo/mongocursor/timeout.xml
deleted file mode 100644
index 4e8128f807..0000000000
--- a/reference/mongo/mongocursor/timeout.xml
+++ /dev/null
@@ -1,133 +0,0 @@
-
-
-
-
-
- MongoCursor::timeout
- Sets a client-side timeout for this query
-
-
-
- &reftitle.description;
-
- publicMongoCursorMongoCursor::timeout
- intms
-
-
- A timeout can be set at any time and will affect subsequent queries on the
- cursor, including fetching more results from the database.
-
-
-
-
- &reftitle.parameters;
-
-
-
- ms
-
-
-
- The number of milliseconds for the cursor to wait for a response. Use
- -1 to wait forever. By default, the cursor will wait
- 30000 milliseconds (30 seconds).
-
-
-
-
-
-
-
- &reftitle.returnvalues;
-
- This cursor.
-
-
-
-
- &reftitle.errors;
-
- Causes methods that fetch results to throw a
- MongoCursorTimeoutException if the query takes longer
- than the specified number of milliseconds.
-
-
-
-
- &reftitle.examples;
-
- MongoCursor::timeout example
-
- In the following example, the driver will wait forever for the initial
- database response, and then wait 100ms for subsequent responses.
-
-
-find();
-$cursor->timeout(-1);
-
-/* $cursor->hasNext() executes the query. An infinite timeout has been set, so
- * the driver will wait as long as necessary for a response.
- */
-while ($cursor->hasNext()) {
- $cursor->timeout(100);
-
- /* A timeout has now been set, so if the cursor needs to get more results
- * from the database, it will only wait 100ms for a response.
- */
- try {
- print_r($cursor->getNext());
- } catch (MongoCursorTimeoutException $e) {
- echo "query took too long!";
- }
-}
-
-?>
-]]>
-
-
-
-
-
- &reftitle.notes;
-
-
- This does not cause the MongoDB server to cancel long-running operations;
- it only instructs the driver to stop waiting for a response and throw a
- MongoCursorTimeoutException after a set time.
- If you need to specify a server-side timeout for a query, consider using
- MongoCursor::maxTimeMS.
-
-
-
-
-
- &reftitle.seealso;
-
- MongoCursorInterface::timeout
- The socketTimeoutMS option for MongoClient::__construct
-
-
-
-
-
diff --git a/reference/mongo/mongocursor/valid.xml b/reference/mongo/mongocursor/valid.xml
deleted file mode 100644
index 0c492172e7..0000000000
--- a/reference/mongo/mongocursor/valid.xml
+++ /dev/null
@@ -1,55 +0,0 @@
-
-
-
-
-
- MongoCursor::valid
- Checks if the cursor is reading a valid result
-
-
-
- &reftitle.description;
-
- publicboolMongoCursor::valid
-
-
-
-
-
- &reftitle.parameters;
- &no.function.parameters;
-
-
-
- &reftitle.returnvalues;
-
- &true; if the current result is not null, and &false; otherwise.
-
-
-
-
- &reftitle.seealso;
-
- Iterator::valid
-
-
-
-
diff --git a/reference/mongo/mongocursorexception.xml b/reference/mongo/mongocursorexception.xml
deleted file mode 100644
index 51b14acc80..0000000000
--- a/reference/mongo/mongocursorexception.xml
+++ /dev/null
@@ -1,435 +0,0 @@
-
-
-
-
-
- The MongoCursorException class
- MongoCursorException
-
-
-
-
-
- &reftitle.intro;
-
- Caused by accessing a cursor incorrectly or a error receiving a reply. Note
- that this can be thrown by any database request that receives a reply, not
- just queries. Writes, commands, and any other operation that sends
- information to the database and waits for a response can throw a
- MongoCursorException. The only exception is
- new MongoClient() (creating a new connection), which will
- only throw MongoConnectionExceptions.
-
-
-
- This returns a specific error message to help diagnose the problem and a
- numeric error code associated with the cause of the exception.
-
-
-
- For example, suppose you tried to insert two documents with the same _id:
-
-insert(array("_id" => 1), array("w" => 1));
- $collection->insert(array("_id" => 1), array("w" => 1));
-}
-catch (MongoCursorException $e) {
- echo "error message: ".$e->getMessage()."\n";
- echo "error code: ".$e->getCode()."\n";
-}
-
-?>
-]]>
-
- This would produce output like:
-
-
-
- Note that the MongoDB error code (11000) is used for the PHP error code. The
- PHP driver uses the "native" error code wherever possible.
-
-
-
- The following is a list of common errors, codes, and causes. Exact errors
- are in italics, errors where the message can vary are described in obliques.
-
-
-
-
-
- cannot modify cursor after beginning iteration
-
-
- Code: 0
-
-
- You are calling a method that sets up the query after executing the query.
- Reset the cursor and try again.
-
-
- An example:
-
-find();
- var_dump($cursor->getNext());
-
- // getNext() queried the database, it's too late to set a limit
- $cursor->limit(1);
-}
-catch (MongoCursorException $e) {
- echo "error message: ".$e->getMessage()."\n";
- echo "error code: ".$e->getCode()."\n";
-}
-
-// this will work, though:
-$cursor->getNext();
-$cursor->reset();
-$cursor->limit(1);
-
-?>
-]]>
-
-
-
-
-
-
- Get next batch send errors
-
-
- Code: 1
-
-
- Could not send the query to the database. Make sure the database is
- still up and the network is okay.
-
-
-
-
-
- cursor not found
-
-
- Code: 2
-
-
- The driver was trying to fetch more results from the database, but the
- database did not have a record of the query. This usually means that the
- cursor timed out on the server side: after a few minutes of inactivity,
- the database will kill a cursor (see
- MongoCursor::immortal for information on preventing
- this).
-
-
- An example:
-
-find();
- $cursor->getNext();
-
- // sleep for 15 minutes
- sleep(60*15);
-
- while ($cursor->hasNext()) {
- $cursor->getNext();
- }
-}
-catch (MongoCursorException $e) {
- echo "error message: ".$e->getMessage()."\n";
- echo "error code: ".$e->getCode()."\n";
-}
-
-?>
-]]>
-
-
-
-
-
-
- cursor->buf.pos is null
-
-
- Code: 3
-
-
- This may indicate you are out of RAM or some other extraordinary
- circumstance.
-
-
-
-
-
- couldn't get response header
-
-
- Code: 4
-
-
- A common error if the database or network goes down. This means that the
- driver couldn't get a response from the connection.
-
-
-
-
-
- no db response
-
-
- Code: 5
-
-
- This may not even be an error, for example, the database command
- "shutdown" returns no response. However, if you were expecting a
- response, this means the database didn't give one.
-
-
-
-
-
- bad response length: %d, did the db assert?
-
-
- Code: 6
-
-
- This means that the database said that its response was less than 0. This
- error probably indicates a network error or database corruption.
-
-
-
-
-
- incomplete header
-
-
- Code: 7
-
-
- Highly unusual. Occurs if the database response started out correctly,
- but broke off in the middle. Probably indicates a network problem.
-
-
-
-
-
- incomplete response
-
-
- Code: 8
-
-
- Highly unusual. Occurs if the database response started out correctly,
- but broke off in the middle. Probably indicates a network problem.
-
-
-
-
-
- couldn't find a response
-
-
- Code: 9
-
-
- If the response was cached and now cannot be located.
-
-
-
-
-
- error getting socket
-
-
- Code: 10
-
-
- The socket was closed or encountered an error. The driver should
- automatically reconnect (if possible) on the next operation.
-
-
-
-
-
- couldn't find reply, please try again
-
-
- Code: 11
-
-
- The driver saves any database responses it cannot immediately match with a
- request. This exception occurs if the driver has already passed your
- request's response and cannot find your response in its cache.
-
-
-
-
-
- error getting database response: errstr
-
-
- WSA error getting database response: errstr
-
-
- "errstr" is an io error reported directly from the C socket
- subsystem. On Windows, the error message is prefixed with "WSA".
-
-
-
-
-
- Timeout error
-
-
- Code: 13
-
-
- If there was an error while waiting for a query to complete.
-
-
-
-
-
- couldn't send query: <various>
-
-
- Code: 14
-
-
- C socket error on send.
-
-
-
-
-
- max number of retries exhausted, couldn't send query
-
-
- Code: 19
-
-
- The driver will automatically retry "plain" queries (not commands) a
- couple of times if the first attempt failed for certain reasons. This is
- to cause fewer exceptions during replica set failover (although you will
- probably still have to deal with some) and gloss over transient network
- issues.
-
-
- This can also be caused by the driver not being able to reconnect at all
- to the database (if, for example, the database is unreachable).
-
-
- Version 1.2.2+.
-
-
-
-
-
-
-
- Errors passed through by the database
-
- Database errors should always trigger
- MongoCursorExceptions on queries.
- Error messages and codes are sent directly from the database and you should
- be able to see matching errors in the database log.
-
-
-
- A few common database errors are listed below:
-
-
-
-
-
- E11000 duplicate key error index: foo.bar.$X dup key: { /* ... */ }
-
-
- Code: 11000
-
-
- Database error for duplicate keys.
-
-
-
-
-
- not master
-
-
- Codes: 10107, 13435, and 10058
-
-
- Not master errors, piped through by the database. ach of these will
- cause the driver to disconnect and attempt to find a new primary. The
- actual error you get on failover may not be a "not master" error,
- depending on when the change in primary occurs.
-
-
-
-
-
-
-
-
- &reftitle.classsynopsis;
-
-
-
- MongoCursorException
-
-
-
-
- MongoCursorException
-
-
- extends
- MongoException
-
-
-
-
-
-
-
-
-
-
-
- &reference.mongo.entities.mongocursorexception;
-
-
-
-
diff --git a/reference/mongo/mongocursorexception/gethost.xml b/reference/mongo/mongocursorexception/gethost.xml
deleted file mode 100644
index 5acc2288e8..0000000000
--- a/reference/mongo/mongocursorexception/gethost.xml
+++ /dev/null
@@ -1,56 +0,0 @@
-
-
-
-
-
- MongoCursorException::getHost
- The hostname of the server that encountered the error
-
-
-
- &reftitle.description;
-
- publicstringMongoCursorException::getHost
-
-
-
- Returns the hostname of the server the query was sent too.
-
-
-
-
-
- &reftitle.parameters;
- &no.function.parameters;
-
-
-
- &reftitle.returnvalues;
-
- Returns the hostname, or NULL if the hostname is unknown.
-
-
-
-
-
-
-
diff --git a/reference/mongo/mongocursorinterface.xml b/reference/mongo/mongocursorinterface.xml
deleted file mode 100644
index 0079075980..0000000000
--- a/reference/mongo/mongocursorinterface.xml
+++ /dev/null
@@ -1,83 +0,0 @@
-
-
-
-
-
- The MongoCursorInterface interface
- MongoCursorInterface
-
-
-
-
-
- &reftitle.intro;
-
- Interface for cursors, which can be used to iterate through results of a
- database query or command. This interface is implemented by the
- MongoCursor and
- MongoCommandCursor classes.
-
-
-
- Similar to Traversable, this interface cannot be
- implemented in PHP scripts.
-
-
-
-
-
-
- &reftitle.classsynopsis;
-
-
-
- MongoCursorInterface
-
-
-
-
- MongoCursorInterface
-
-
-
- extends
- Iterator
-
-
-
-
- &Methods;
-
-
- &InheritedMethods;
-
-
-
-
-
-
-
- &reference.mongo.entities.mongocursorinterface;
-
-
-
-
diff --git a/reference/mongo/mongocursorinterface/batchsize.xml b/reference/mongo/mongocursorinterface/batchsize.xml
deleted file mode 100644
index 7a83c78400..0000000000
--- a/reference/mongo/mongocursorinterface/batchsize.xml
+++ /dev/null
@@ -1,68 +0,0 @@
-
-
-
-
-
- MongoCursorInterface::batchSize
- Limits the number of elements returned in one batch
-
-
-
- &reftitle.description;
-
- abstractpublicMongoCursorInterfaceMongoCursorInterface::batchSize
- intbatchSize
-
-
- A cursor typically fetches a batch of result objects and stores them
- locally. This method sets the batch size value to configure the amount of
- documents retrieved from the server in one round trip.
-
-
-
-
- &reftitle.parameters;
-
-
-
-
- batchSize
-
-
-
- The number of results to return per batch.
-
-
-
-
-
-
-
-
- &reftitle.returnvalues;
-
- Returns this cursor.
-
-
-
-
-
diff --git a/reference/mongo/mongocursorinterface/dead.xml b/reference/mongo/mongocursorinterface/dead.xml
deleted file mode 100644
index 4aef6503db..0000000000
--- a/reference/mongo/mongocursorinterface/dead.xml
+++ /dev/null
@@ -1,56 +0,0 @@
-
-
-
-
-
- MongoCursorInterface::dead
- Checks if there are results that have not yet been sent from the database
-
-
-
- &reftitle.description;
-
- abstractpublicboolMongoCursorInterface::dead
-
-
-
- This method checks whether the cursor has been exhausted and the database has
- no more results to send to the client. A cursor being "dead" does not
- necessarily mean that there are no more results available for iteration.
-
-
-
-
- &reftitle.parameters;
- &no.function.parameters;
-
-
-
- &reftitle.returnvalues;
-
- Returns &true; if there are more results that have not yet been sent to the
- client, and &false; otherwise.
-
-
-
-
-
diff --git a/reference/mongo/mongocursorinterface/getreadpreference.xml b/reference/mongo/mongocursorinterface/getreadpreference.xml
deleted file mode 100644
index 8dc235eb33..0000000000
--- a/reference/mongo/mongocursorinterface/getreadpreference.xml
+++ /dev/null
@@ -1,56 +0,0 @@
-
-
-
-
-
- MongoCursorInterface::getReadPreference
- Get the read preference for this query
-
-
-
- &reftitle.description;
-
- abstractpublicarrayMongoCursorInterface::getReadPreference
-
-
-
-
-
- &reftitle.parameters;
- &no.function.parameters;
-
-
-
- &reftitle.returnvalues;
- &mongo.getreadpreference.returnvalues;
-
-
-
- &reftitle.seealso;
-
- The read preferences documentation.
- MongoCursorInterface::setReadPreference
-
-
-
-
-
diff --git a/reference/mongo/mongocursorinterface/info.xml b/reference/mongo/mongocursorinterface/info.xml
deleted file mode 100644
index fdb0376142..0000000000
--- a/reference/mongo/mongocursorinterface/info.xml
+++ /dev/null
@@ -1,56 +0,0 @@
-
-
-
-
-
- MongoCursorInterface::info
- Gets information about the cursor's creation and iteration
-
-
-
- &reftitle.description;
-
- abstractpublicarrayMongoCursorInterface::info
-
-
-
- Returns information about the cursor's creation and iteration. This can be
- called before or after the cursor has started iterating.
-
-
-
-
- &reftitle.parameters;
- &no.function.parameters;
-
-
-
- &reftitle.returnvalues;
-
- Returns the namespace, batch size, limit, skip, flags, query, and projected
- fields for this cursor. If the cursor has started iterating, additional
- information about iteration and the connection will be included.
-
-
-
-
-
diff --git a/reference/mongo/mongocursorinterface/setreadpreference.xml b/reference/mongo/mongocursorinterface/setreadpreference.xml
deleted file mode 100644
index ba6e253a3e..0000000000
--- a/reference/mongo/mongocursorinterface/setreadpreference.xml
+++ /dev/null
@@ -1,64 +0,0 @@
-
-
-
-
-
- MongoCursorInterface::setReadPreference
- Set the read preference for this query
-
-
-
- &reftitle.description;
-
- abstractpublicMongoCursorInterfaceMongoCursorInterface::setReadPreference
- stringread_preference
- arraytags
-
-
-
-
- &reftitle.parameters;
- &mongo.setreadpreference.parameters;
-
-
-
- &reftitle.returnvalues;
-
- Returns this cursor.
-
-
-
-
- &reftitle.errors;
- &mongo.setreadpreference.errors;
-
-
-
- &reftitle.seealso;
-
- The read preferences documentation.
- MongoCursorInterface::getReadPreference
-
-
-
-
-
diff --git a/reference/mongo/mongocursorinterface/timeout.xml b/reference/mongo/mongocursorinterface/timeout.xml
deleted file mode 100644
index 7c0272bf0f..0000000000
--- a/reference/mongo/mongocursorinterface/timeout.xml
+++ /dev/null
@@ -1,84 +0,0 @@
-
-
-
-
-
- MongoCursorInterface::timeout
- Sets a client-side timeout for this query
-
-
-
- &reftitle.description;
-
- abstractpublicMongoCursorInterfaceMongoCursorInterface::timeout
- intms
-
-
- A timeout can be set at any time and will affect subsequent data retrieval
- associated with this cursor, including fetching more results from the
- database.
-
-
-
-
- &reftitle.parameters;
-
-
-
- ms
-
-
-
- The number of milliseconds for the cursor to wait for a response. Use
- -1 to wait forever. By default, the cursor will wait
- 30000 milliseconds (30 seconds).
-
-
-
-
-
-
-
- &reftitle.returnvalues;
-
- Returns this cursor.
-
-
-
-
- &reftitle.errors;
-
- Causes methods that fetch results to throw a
- MongoCursorTimeoutException if the data fetch takes
- longer than the specified number of milliseconds.
-
-
-
-
- &reftitle.seealso;
-
- The socketTimeoutMS option for MongoClient::__construct
-
-
-
-
-
diff --git a/reference/mongo/mongocursortimeoutexception.xml b/reference/mongo/mongocursortimeoutexception.xml
deleted file mode 100644
index 0bd2ff42ef..0000000000
--- a/reference/mongo/mongocursortimeoutexception.xml
+++ /dev/null
@@ -1,73 +0,0 @@
-
-
-
-
-
- The MongoCursorTimeoutException class
- MongoCursorTimeoutException
-
-
-
-
-
- &reftitle.intro;
-
- Caused by a query timing out. You can set the length of time to wait before
- this exception is thrown by calling
- MongoCursor::timeout on the cursor or setting
- MongoCursor::$timeout. The static variable is useful for
- queries such as database commands and
- MongoCollection::findOne, both of which implicitly use
- cursors.
-
-
-
-
-
- &reftitle.classsynopsis;
-
-
-
- MongoCursorTimeoutException
-
-
-
-
- MongoCursorTimeoutException
-
-
- extends
- MongoCursorException
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/reference/mongo/mongodate.xml b/reference/mongo/mongodate.xml
deleted file mode 100644
index 2a37c78a25..0000000000
--- a/reference/mongo/mongodate.xml
+++ /dev/null
@@ -1,114 +0,0 @@
-
-
-
-
-
- The MongoDate class
- MongoDate
-
-
-
-
- &mongo.alternative.class.note;
-
- MongoDB\BSON\UTCDateTime
-
-
-
-
-
- &reftitle.intro;
-
- Represent date objects for the database. This class should be used to save
- dates to the database and to query for dates. For example:
-
-
- Storing dates with MongoDate
-
-save(array("ts" => new MongoDate()));
-
-$start = new MongoDate(strtotime("2010-01-15 00:00:00"));
-$end = new MongoDate(strtotime("2010-01-30 00:00:00"));
-
-// find dates between 1/15/2010 and 1/30/2010
-$collection->find(array("ts" => array('$gt' => $start, '$lte' => $end)));
-
-?>
-]]>
-
-
-
- MongoDB stores dates as milliseconds past the epoch. This means that dates
- do not contain timezone information. Timezones must be
- stored in a separate field if needed. Second, this means that any precision
- beyond milliseconds will be lost when the document is sent to/from the
- database.
-
-
-
-
-
- &reftitle.classsynopsis;
-
-
-
- MongoDate
-
-
-
-
- MongoDate
-
-
-
-
- Fields
-
- public
- int
- sec
-
-
- public
- int
- usec
-
-
-
- &Methods;
-
-
-
-
-
-
-
-
- &reference.mongo.entities.mongodate;
-
-
-
-
diff --git a/reference/mongo/mongodate/construct.xml b/reference/mongo/mongodate/construct.xml
deleted file mode 100644
index 6f2a6f2aa0..0000000000
--- a/reference/mongo/mongodate/construct.xml
+++ /dev/null
@@ -1,128 +0,0 @@
-
-
-
-
-
- MongoDate::__construct
- Creates a new date
-
-
-
-
- &mongo.alternative.method.note;
-
- MongoDB\BSON\UTCDateTime::__construct
-
-
-
-
-
- &reftitle.description;
-
- publicMongoDate::__construct
- intsectime()
- intusec0
-
-
- Creates a new date. If no parameters are given, the current time is used.
-
-
-
-
- &reftitle.parameters;
-
-
-
-
- sec
-
-
-
- Number of seconds since the epoch (i.e. 1 Jan 1970 00:00:00.000 UTC).
-
-
-
-
-
- usec
-
-
-
- Microseconds. Please be aware though that MongoDB's resolution is
- milliseconds and not microseconds, which means this
- value will be truncated to millisecond resolution.
-
-
-
-
-
-
-
-
- &reftitle.returnvalues;
-
- Returns this new date.
-
-
-
-
- &reftitle.examples;
-
- MongoDate::__construct example
- This example demonstrates creating a new date with the current time and a new date with a given time.
-
-
-]]>
-
- &example.outputs.similar;
-
-
-
-
-
-
-
- &reftitle.seealso;
-
-
- MongoDate::__toString
-
-
-
-
-
-
-
diff --git a/reference/mongo/mongodate/todatetime.xml b/reference/mongo/mongodate/todatetime.xml
deleted file mode 100644
index 1f08f86f4f..0000000000
--- a/reference/mongo/mongodate/todatetime.xml
+++ /dev/null
@@ -1,93 +0,0 @@
-
-
-
-
-
- MongoDate::toDateTime
- Returns a DateTime object representing this date
-
-
-
-
- &mongo.alternative.method.note;
-
- MongoDB\BSON\UTCDateTime::toDateTime
-
-
-
-
-
- &reftitle.description;
-
- publicDateTimeMongoDate::toDateTime
-
-
-
- Returns the DateTime representation of this date. The
- returned DateTime will use the UTC time zone.
-
-
-
-
- &reftitle.parameters;
- &no.function.parameters;
-
-
-
- &reftitle.returnvalues;
-
- This date as a DateTime object.
-
-
-
-
- &reftitle.examples;
-
- MongoDate::toDateTime example
- This example demonstrates creating a DateTime object from a MongoDate
- object.
-
-toDateTime() );
-?>
-]]>
-
- &example.outputs.similar;
-
-
- string(26) "2014-11-18 11:01:25.000000"
- public $timezone_type =>
- int(1)
- public $timezone =>
- string(6) "+00:00"
-}
-]]>
-
-
-
-
-
-
diff --git a/reference/mongo/mongodate/tostring.xml b/reference/mongo/mongodate/tostring.xml
deleted file mode 100644
index 8ff8aa0c39..0000000000
--- a/reference/mongo/mongodate/tostring.xml
+++ /dev/null
@@ -1,62 +0,0 @@
-
-
-
-
-
- MongoDate::__toString
- Returns a string representation of this date
-
-
-
-
- &mongo.alternative.method.note;
-
- MongoDB\BSON\UTCDateTime::__toString
-
-
-
-
-
- &reftitle.description;
-
- publicstringMongoDate::__toString
-
-
-
- Returns a string representation of this date, similar to the representation returned by microtime.
-
-
-
-
- &reftitle.parameters;
- &no.function.parameters;
-
-
-
- &reftitle.returnvalues;
-
- This date.
-
-
-
-
-
diff --git a/reference/mongo/mongodb.xml b/reference/mongo/mongodb.xml
deleted file mode 100644
index 3da17a070b..0000000000
--- a/reference/mongo/mongodb.xml
+++ /dev/null
@@ -1,225 +0,0 @@
-
-
-
-
-
- The MongoDB class
- MongoDB
-
-
-
-
-
- &reftitle.intro;
-
- Instances of this class are used to interact with a database. To get a
- database:
-
- Selecting a database
-
-selectDB("example");
-
-?>
-]]>
-
-
- Database names can use almost any character in the ASCII range. However,
- they cannot contain " ", "." or be the empty string.
- The name "system" is also reserved.
-
-
- A few unusual, but valid, database names: "null", "[x,y]", "3", "\"", "/".
-
-
- Unlike collection names, database names may contain "$".
-
-
-
-
-
- &reftitle.classsynopsis;
-
-
-
- MongoDB
-
-
-
-
- MongoDB
-
-
-
-
- &Constants;
-
- const
- int
- MongoDB::PROFILING_OFF
- 0
-
-
- const
- int
- MongoDB::PROFILING_SLOW
- 1
-
-
- const
- int
- MongoDB::PROFILING_ON
- 2
-
-
- Fields
-
- public
- int
- w
- 1
-
-
- public
- int
- wtimeout
- 10000
-
-
- &Methods;
-
-
-
-
-
-
-
- &reftitle.constants;
-
- MongoDB Log Levels
-
-
-
- MongoDB::PROFILING_OFF
-
-
- Profiling is off.
-
-
-
-
- MongoDB::PROFILING_SLOW
-
-
- Profiling is on for slow operations (>100 ms).
-
-
-
-
- MongoDB::PROFILING_ON
-
-
- Profiling is on for all operations.
-
-
-
-
-
-
-
-
- Fields
-
-
- w
- 1
-
-
- The number of servers to replicate a change to before returning success.
- Inherited by instances of MongoCollection derived
- from this. w functionality is only available in
- version 1.5.1+ of the MongoDB server and 1.0.8+ of the driver.
-
-
- w is used whenever you need to adjust the
- acknowledgement level
- (MongoCollection::insert,
- MongoCollection::update,
- MongoCollection::remove,
- MongoCollection::save, and
- MongoCollection::ensureIndex all support this
- option). With the default value (1), an acknowledged operation will return once
- the database server has the operation. If the server goes down before
- the operation has been replicated to a secondary, it is possible to lose
- the operation forever. Thus, you can specify w to be
- higher than one and guarantee that at least one secondary has the
- operation before it is considered successful.
-
-
- For example, if w is 2, the primary and one secondary
- must have a record of the operation or the driver will throw a
- MongoCursorException. It is tempting to set
- w to the total number of secondaries + primary, but
- then if one secondary is down the operation will fail and an exception
- will be thrown, so usually w=2 is safest (primary and
- one secondary).
-
-
-
-
- wtimeout
- 10000
-
-
- The number of milliseconds to wait for MongoDB::$w
- replications to take place. Inherited by instances of
- MongoCollection derived from this.
- w functionality is only available in version 1.5.1+ of
- the MongoDB server and 1.0.8+ of the driver.
-
-
- Unless wtimeout is set, the server waits forever for
- replicating to w servers to finish. The driver
- defaults to waiting for 10 seconds, you can change this value to alter
- its behavior.
-
-
-
-
-
-
-
- &reftitle.seealso;
-
- MongoDB core docs on databases.
-
-
-
-
- &reference.mongo.entities.mongodb;
-
-
-
-
diff --git a/reference/mongo/mongodb/authenticate.xml b/reference/mongo/mongodb/authenticate.xml
deleted file mode 100644
index 4ce587dc01..0000000000
--- a/reference/mongo/mongodb/authenticate.xml
+++ /dev/null
@@ -1,177 +0,0 @@
-
-
-
-
-
- MongoDB::authenticate
- Log in to this database
-
-
-
-
- &mongo.noalternative.method.note;
- Instead, you need to provide credentials through the connection
- string.
-
-
-
-
- &reftitle.description;
-
- publicarrayMongoDB::authenticate
- stringusername
- stringpassword
-
-
- This method causes its connection to be authenticated. If authentication is
- enabled for the database server (it's not, by default), you need to log in
- before the database will allow you to do anything.
-
-
- In general, you should use the authenticate built into
- MongoClient::__construct in preference to this method.
- If you authenticate on connection and the connection drops and reconnects
- during your session, you'll be reauthenticated. If you manually
- authenticated using this method and the connection drops, you'll have to call
- this method again once you're reconnected.
-
-
- This method is identical to running:
-
-command(array("getnonce" => 1));
-
-$saltedHash = md5($nonce["nonce"]."${username}${hash}");
-
-$result = $db->command(array("authenticate" => 1,
- "user" => $username,
- "nonce" => $nonce["nonce"],
- "key" => $saltedHash
-));
-
-?>
-]]>
-
-
-
- Once a connection has been authenticated, it can only be un-authenticated by
- using the "logout" database command:
-
-command(array("logout" => 1));
-
-?>
-]]>
-
-
-
-
- &reftitle.parameters;
-
-
-
-
- username
-
-
-
- The username.
-
-
-
-
-
- password
-
-
-
- The password (in plaintext).
-
-
-
-
-
-
-
- &reftitle.returnvalues;
-
- Returns database response. If the login was successful, it will return
-
- 1);
-?>
-]]>
-
- If something went wrong, it will return
-
- 0, "errmsg" => "auth fails");
-?>
-]]>
-
- ("auth fails" could be another message, depending on database version and what
- when wrong).
-
-
-
-
- &reftitle.seealso;
-
- MongoDB core docs on authenticate.
-
-
-
-
- &reftitle.changelog;
-
-
-
-
-
- &Version;
- &Description;
-
-
-
-
- PECL mongo 1.2.11
-
- Emits E_DEPRECATED when used. Please pass in the
- authentication details to the constructor.
-
-
-
-
-
-
-
-
-
-
diff --git a/reference/mongo/mongodb/command.xml b/reference/mongo/mongodb/command.xml
deleted file mode 100644
index f0d57b61f2..0000000000
--- a/reference/mongo/mongodb/command.xml
+++ /dev/null
@@ -1,348 +0,0 @@
-
-
-
-
-
- MongoDB::command
- Execute a database command
-
-
- &reftitle.description;
-
- publicarrayMongoDB::command
- arraycommand
- arrayoptionsarray()
- stringhash
-
-
- Almost everything that is not a CRUD operation can be done with a database
- command. Need to know the database version? There's a command for that.
- Need to do aggregation? There's a command for that. Need to turn up
- logging? You get the idea.
-
-
- This method is identical to:
-
-selectCollection('$cmd')->findOne($data);
-}
-
-?>
-]]>
-
-
-
-
- &reftitle.parameters;
-
-
-
-
- command
-
-
-
- The query to send.
-
-
-
-
-
- options
-
-
-
- An array of options for the index creation. Currently available options
- include:
-
- &mongo.writes.parameters.sockettimeoutms;
-
-
-
- The following options are deprecated and should no longer be used:
-
- &mongo.writes.parameters.timeout;
-
-
-
-
-
-
- hash
-
-
-
- Set to the connection hash of the server that executed the command. When
- the command result is suitable for creating a
- MongoCommandCursor, the hash is intended to be
- passed to MongoCommandCursor::createFromDocument.
-
-
- The hash will also correspond to a connection returned from
- MongoClient::getConnections.
-
-
-
-
-
-
-
-
- &reftitle.changelog;
-
-
-
-
-
- &Version;
- &Description;
-
-
-
-
- PECL mongo 1.5.0
-
-
- Renamed the "timeout" option to
- "socketTimeoutMS". Emits
- E_DEPRECATED when "timeout" is
- used.
-
-
- Added hash by-reference parameter.
-
-
-
-
- PECL mongo 1.2.0
-
- Added options parameter with a single option:
- "timeout".
-
-
-
-
-
-
-
-
-
- &reftitle.returnvalues;
-
- Returns database response. Every database response is always maximum one
- document, which means that the result of a database command can never
- exceed 16MB. The resulting document's structure depends on the command, but
- most results will have the ok field to indicate success
- or failure and results containing an array of each of
- the resulting documents.
-
-
-
-
- &reftitle.examples;
-
- MongoDB::command "distinct" example
-
- Finding all of the distinct values for a key.
-
-
-people;
-
-$people->insert(array("name" => "Joe", "age" => 4));
-$people->insert(array("name" => "Sally", "age" => 22));
-$people->insert(array("name" => "Dave", "age" => 22));
-$people->insert(array("name" => "Molly", "age" => 87));
-
-$ages = $db->command(array("distinct" => "people", "key" => "age"));
-
-foreach ($ages['values'] as $age) {
- echo "$age\n";
-}
-
-?>
-]]>
-
- &example.outputs.similar;
-
-4
-22
-87
-
-
-
-
- MongoDB::command "distinct" example
-
- Finding all of the distinct values for a key, where the value is larger
- than or equal to 18.
-
-
-people;
-
-$people->insert(array("name" => "Joe", "age" => 4));
-$people->insert(array("name" => "Sally", "age" => 22));
-$people->insert(array("name" => "Dave", "age" => 22));
-$people->insert(array("name" => "Molly", "age" => 87));
-
-$ages = $db->command(
- array(
- "distinct" => "people",
- "key" => "age",
- "query" => array("age" => array('$gte' => 18))
- )
-);
-
-foreach ($ages['values'] as $age) {
- echo "$age\n";
-}
-
-?>
-]]>
-
- &example.outputs.similar;
-
-22
-87
-
-
-
-
- MongoDB::command MapReduce example
-
- Get all users with at least on "sale" event, and how many times each
- of these users has had a sale.
-
-
-insert(array("user_id" => $id,
- "type" => $type,
- "time" => new MongoDate(),
- "desc" => $description));
-
-// construct map and reduce functions
-$map = new MongoCode("function() { emit(this.user_id,1); }");
-$reduce = new MongoCode("function(k, vals) { ".
- "var sum = 0;".
- "for (var i in vals) {".
- "sum += vals[i];".
- "}".
- "return sum; }");
-
-$sales = $db->command(array(
- "mapreduce" => "events",
- "map" => $map,
- "reduce" => $reduce,
- "query" => array("type" => "sale"),
- "out" => array("merge" => "eventCounts")));
-
-$users = $db->selectCollection($sales['result'])->find();
-
-foreach ($users as $user) {
- echo "{$user['_id']} had {$user['value']} sale(s).\n";
-}
-
-?>
-]]>
-
- &example.outputs.similar;
-
-User 47cc67093475061e3d9536d2 had 3 sale(s).
-User 49902cde5162504500b45c2c had 14 sale(s).
-User 4af467e4fd543cce7b0ea8e2 had 1 sale(s).
-
-
- Using MongoCode
-
- This example uses MongoCode, which can also take a
- scope argument. However, at the moment, MongoDB does not support using
- scopes in MapReduce. If you would like to use client-side variables in the
- MapReduce functions, you can add them to the global scope by using the
- optional scope field with the database command. See the
- MapReduce documentation
- for more information.
-
-
-
- The out argument
-
- Before 1.8.0, the out argument was optional. If you did
- not use it, MapReduce results would be written to a temporary collection,
- which would be deleted when your connection was closed. In 1.8.0+, the
- out argument is required. See the
- MapReduce documentation
- for more information.
-
-
-
-
-
- MongoDB::command "geoNear" example
-
- This example shows how to use the geoNear command.
-
-
-demo;
-$c = $d->poiConcat;
-
-$r = $d->command(array(
- 'geoNear' => "poiConcat", // Search in the poiConcat collection
- 'near' => array(-0.08, 51.48), // Search near 51.48°N, 0.08°E
- 'spherical' => true, // Enable spherical search
- 'num' => 5, // Maximum 5 returned documents
-));
-print_r($r);
-?>
-]]>
-
-
-
-
-
- &reftitle.seealso;
-
-
- MongoCollection::aggregate
- MongoCollection::findAndModify
- MongoCollection::group
-
-
-
- MongoDB core docs on
- database commands.
-
-
-
-
diff --git a/reference/mongo/mongodb/construct.xml b/reference/mongo/mongodb/construct.xml
deleted file mode 100644
index 532dcceef8..0000000000
--- a/reference/mongo/mongodb/construct.xml
+++ /dev/null
@@ -1,117 +0,0 @@
-
-
-
-
-
- MongoDB::__construct
- Creates a new database
-
-
-
- &reftitle.description;
-
- publicMongoDB::__construct
- MongoClientconn
- stringname
-
-
- This method is not meant to be called directly. The preferred way to create
- an instance of MongoDB is through MongoClient::__get or
- MongoClient::selectDB.
-
-
- If you're ignoring the previous paragraph and want to call it directly you
- can do so:
-
-
-
-]]>
-
-
- But don't. Isn't this much nicer:
-
-
-mydbname;
-
-// or, if the name contains weird characters:
-
-$db = $m->selectDB('my,db:name');
-
-?>
-]]>
-
-
-
-
- &reftitle.parameters;
-
-
-
-
- MongoClient
- conn
-
-
-
- Database connection.
-
-
-
-
-
- name
-
-
-
- Database name.
-
-
-
-
-
-
-
-
- &reftitle.returnvalues;
-
- Returns the database.
-
-
-
-
- &reftitle.errors;
-
- Throws default exception if the database name is invalid.
-
-
-
-
-
diff --git a/reference/mongo/mongodb/createcollection.xml b/reference/mongo/mongodb/createcollection.xml
deleted file mode 100644
index 8fa67097a8..0000000000
--- a/reference/mongo/mongodb/createcollection.xml
+++ /dev/null
@@ -1,245 +0,0 @@
-
-
-
-
-
- MongoDB::createCollection
- Creates a collection
-
-
- &reftitle.description;
-
- publicMongoCollectionMongoDB::createCollection
- stringname
- arrayoptions
-
-
-
- This method is used to create capped collections and other collections
- requiring special options. It is identical to running:
-
-command(array(
- "create" => $name,
- "capped" => $options["capped"],
- "size" => $options["size"],
- "max" => $options["max"],
- "autoIndexId" => $options["autoIndexId"],
-));
-
-?>
-]]>
-
- See MongoDB::command for more information about database commands.
-
-
-
-
- &reftitle.parameters;
-
-
-
-
-
- name
-
-
-
- The name of the collection.
-
-
-
-
-
-
- options
-
-
-
- An array containing options for the collections. Each option is its own
- element in the options array, with the option name listed below being
- the key of the element. The supported options depend on the MongoDB
- server version and storage engine, and the driver passes any option
- that you give it straight to the server. A few of the supported options
- are, but you can find a full list in the MongoDB core docs on createCollection:
-
-
-
-
-
- capped
-
-
-
- If the collection should be a fixed size.
-
-
-
-
-
- size
-
-
-
- If the collection is fixed size, its size in bytes.
-
-
-
-
-
- max
-
-
-
- If the collection is fixed size, the maximum number of elements to
- store in the collection.
-
-
-
-
-
- autoIndexId
-
-
-
- If capped is &true; you can specify &false; to disable the
- automatic index created on the _id field.
- Before MongoDB 2.2, the default value for
- autoIndexId was &false;.
-
-
-
-
-
-
-
-
-
-
-
-
- &reftitle.returnvalues;
-
- Returns a collection object representing the new collection.
-
-
-
- &reftitle.examples;
-
- MongoDB::createCollection capped collection example
-
- A capped collection is a special type of collection that has either a fixed
- or a fixed number of elements. Once the collection is "full," the oldest
- elements will be removed when new elements are added. Capped collections
- can be very useful for applications like logging, where you may want to
- reserve a certain amount of space for logs and not worry about them
- getting too big.
-
-
- This example creates a very tiny log collection that will keep a maximum of
- 10 documents.
-
-
-createCollection(
- "logger",
- array(
- 'capped' => true,
- 'size' => 10*1024,
- 'max' => 10
- )
-);
-
-for ($i = 0; $i < 100; $i++) {
- $log->insert(array("level" => WARN, "msg" => "sample log message #$i", "ts" => new MongoDate()));
-}
-
-$msgs = $log->find();
-
-foreach ($msgs as $msg) {
- echo $msg['msg']."\n";
-}
-
-?>
-]]>
-
- &example.outputs.similar;
-
-sample log message #90
-sample log message #91
-sample log message #92
-sample log message #93
-sample log message #94
-sample log message #95
-sample log message #96
-sample log message #97
-sample log message #98
-sample log message #99
-
-
-
-
-
- &reftitle.changelog;
-
-
-
-
-
- &Version;
- &Description;
-
-
-
-
- PECL mongo 1.4.0
-
-
- In versions before 1.4.0, the options were all arguments to the method. The
- function synopsis in those older versions is:
-
-
-
- publicMongoCollectionMongoDB::createCollection
- stringname
- boolcapped&false;
- intsize0
- intmax0
-
-
-
- The meaning of the options is the same as described under the
- options argument above.
-
-
-
-
-
-
-
-
-
-
diff --git a/reference/mongo/mongodb/createdbref.xml b/reference/mongo/mongodb/createdbref.xml
deleted file mode 100644
index 57a9704594..0000000000
--- a/reference/mongo/mongodb/createdbref.xml
+++ /dev/null
@@ -1,152 +0,0 @@
-
-
-
-
-
- MongoDB::createDBRef
- Creates a database reference
-
-
-
- &reftitle.description;
-
- publicarrayMongoDB::createDBRef
- stringcollection
- mixeddocument_or_id
-
-
- This method is a flexible interface for creating database refrences (see
- MongoDBRef).
-
-
-
-
- &reftitle.parameters;
-
-
-
-
- collection
-
-
-
- The collection to which the database reference will point.
-
-
-
-
-
- document_or_id
-
-
-
- If an array or object is given, its _id field will be
- used as the reference ID. If a MongoId or scalar
- is given, it will be used as the reference ID.
-
-
-
-
-
-
-
-
- &reftitle.returnvalues;
-
- Returns a database reference array.
-
-
- If an array without an _id field was provided as the
- document_or_id parameter, &null; will be returned.
-
-
-
- &reftitle.examples;
-
- MongoDB::createDBRef example
-
- Example demonstrating how to programatically create a DB reference array from
- a document.
-
-
-articles;
-
-$article = array(
- 'title' => 'Test article',
- 'description' => 'Test article description'
-);
-
-$articles->insert($article);
-$ref = $db->createDBRef('articles', $article);
-
-print_r($article);
-print_r($ref);
-?>
-]]>
-
- &example.outputs.similar;
-
- Test article
- [description] => Test article description
- [_id] => MongoId Object
- (
- )
-
- )
- Array
- (
- [$ref] => articles
- [$id] => MongoId Object
- (
- )
-
- )
- ]]>
-
-
- Now the $ref can be stored on another document and retrieved later with
- MongoDB::getDBRef or MongoCollection::getDBRef.
-
-
-
- MongoDB::createDBRef example
-
- Example demonstrating how to programatically create a DB reference from just an id.
-
-
-createDBRef('articles', $id);
-?>
-]]>
-
-
-
-
-
diff --git a/reference/mongo/mongodb/drop.xml b/reference/mongo/mongodb/drop.xml
deleted file mode 100644
index 89a96f1c5b..0000000000
--- a/reference/mongo/mongodb/drop.xml
+++ /dev/null
@@ -1,95 +0,0 @@
-
-
-
-
-
- MongoDB::drop
- Drops this database
-
-
-
- &reftitle.description;
-
- publicarrayMongoDB::drop
-
-
-
- This drops the database currently being used.
-
-
- This is identical to running:
-
-command(array("dropDatabase" => 1));
-}
-
-?>
-]]>
-
-
-
-
-
- &reftitle.parameters;
- &no.function.parameters;
-
-
-
- &reftitle.returnvalues;
-
- Returns the database response.
-
-
-
-
- &reftitle.examples;
-
- MongoDB::drop example
- This example demonstrates how to drop a mongo database and the response to expect.
-
-foo;
-$response = $db->drop();
-print_r($response);
-
-?>
-]]>
-
- &example.outputs.similar;
-
- foo.$cmd
- [ok] => 1
-)
-]]>
-
-
-
-
-
-
diff --git a/reference/mongo/mongodb/dropcollection.xml b/reference/mongo/mongodb/dropcollection.xml
deleted file mode 100644
index 5895fcabff..0000000000
--- a/reference/mongo/mongodb/dropcollection.xml
+++ /dev/null
@@ -1,71 +0,0 @@
-
-
-
-
-
- MongoDB::dropCollection
- Drops a collection [deprecated]
-
-
- &reftitle.description;
-
- publicarrayMongoDB::dropCollection
- mixedcoll
-
-
-
- Deprecated
-
- Use MongoCollection::drop instead.
-
-
-
- This function leaks memory in version 1.0.7 and earlier!
-
-
-
-
-
-
- &reftitle.parameters;
-
-
-
-
- coll
-
-
-
- MongoCollection or name of collection to drop.
-
-
-
-
-
-
-
- &reftitle.returnvalues;
-
- Returns the database response.
-
-
-
-
diff --git a/reference/mongo/mongodb/execute.xml b/reference/mongo/mongodb/execute.xml
deleted file mode 100644
index 15c3553e56..0000000000
--- a/reference/mongo/mongodb/execute.xml
+++ /dev/null
@@ -1,258 +0,0 @@
-
-
-
-
-
- MongoDB::execute
- Runs JavaScript code on the database server [deprecated]
-
-
-
- &reftitle.description;
-
- publicarrayMongoDB::execute
- mixedcode
- arrayargsarray()
-
-
-
- The eval command,
- which this method invokes, is deprecated in MongoDB 3.0+.
-
-
-
- The Mongo database server runs a JavaScript engine. This method allows you
- to run arbitary JavaScript on the database. This can be useful if you want
- touch a number of collections lightly, or process some results on the
- database side to reduce the amount that has to be sent to the client.
-
-
- Running JavaScript in the database takes a write lock, meaning it blocks
- other operations. Make sure you consider this before running a long script.
-
-
- This is a wrapper for the
- eval database
- command. This method is basically:
-
-command(array('eval' => $code, 'args' => $args));
-}
-
-?>
-]]>
-
-
-
- MongoDB implies a return statement if you have a single statement on a single
- line. This can cause some unintuitive behavior. For example, this returns
- "foo":
-
-
-execute('"foo";');
-
-?>
-]]>
-
-
- However, these return &null;:
-
-
-execute('"bar"; "foo";'); // more than one statement
-
-$db->execute('db.foo.count(
-);'); // more than one line
-
-?>
-]]>
-
-
- To avoid surprising behavior, it is best not to depend on MongoDB to decide
- what to return, but to explicitly state a return value. In the examples
- above, we can change them to:
-
-
-execute('"bar"; return "foo";');
-
-$db->execute('return db.foo.count(
-);');
-
-?>
-]]>
-
-
- Now the first statement will return "foo" and the second statement will
- return a count of the "foo" collection.
-
-
-
-
- &reftitle.parameters;
-
-
-
-
- code
-
-
-
- MongoCode or string to execute.
-
-
-
-
-
- args
-
-
-
- Arguments to be passed to code.
-
-
-
-
-
-
-
-
- &reftitle.returnvalues;
-
- Returns the result of the evaluation.
-
-
-
-
- &reftitle.examples;
-
- Simple MongoDB::execute example
-
-execute("function() { return 'Hello, world!'; }");
-echo $response['retval'];
-
-?>
-]]>
-
- &example.outputs.similar;
-
-Hello, world!
-
-
-
- Parameter MongoDB::execute example
-
- The optional array of parameters will be passed to the JavaScript function.
-
-
-execute("function(greeting, name) { return greeting+', '+name+'!'; }", array("Good bye", "Joe"));
-echo $response['retval'];
-
-?>
-]]>
-
- &example.outputs.similar;
-
-Good bye, Joe!
-
-
-
- Scope example
-
- If a MongoCode object is used instead of a string for
- the first parameter, a scope can be passed in which the JavaScript will be
- executed.
-
-
- "Fred");
-
-$code = new MongoCode($func, $scope);
-
-$response = $db->execute($code, array("Goodbye", "Joe"));
-echo $response['retval'];
-
-?>
-]]>
-
- &example.outputs.similar;
-
-Goodbye, Joe, says Fred
-
-
-
-
-
- &reftitle.seealso;
-
- The MongoDB eval command docs
-
-
-
-
- &reftitle.changelog;
-
-
-
-
-
- &Version;
- &Description;
-
-
-
-
- PECL mongo 1.7.0
-
- This method has been deprecated as a result of the underlaying
- eval command
- being deprecated in MongoDB 3.0+.
-
-
-
-
-
-
-
-
-
diff --git a/reference/mongo/mongodb/forceerror.xml b/reference/mongo/mongodb/forceerror.xml
deleted file mode 100644
index c35bbc5037..0000000000
--- a/reference/mongo/mongodb/forceerror.xml
+++ /dev/null
@@ -1,90 +0,0 @@
-
-
-
-
-
- MongoDB::forceError
- Creates a database error
-
-
-
- &reftitle.description;
-
- publicboolMongoDB::forceError
-
-
-
- This method is not very useful for normal MongoDB use. It forces a database
- error to occur. This means that MongoDB::lastError will
- return a generic database error after running this command.
-
-
- This command is identical to running:
-
-command(array('forceerror' => 1));
-}
-
-?>
-]]>
-
-
-
-
-
- &reftitle.parameters;
- &no.function.parameters;
-
-
-
- &reftitle.returnvalues;
-
- Returns the database response.
-
-
-
-
- &reftitle.changelog;
-
-
-
-
-
- &Version;
- &Description;
-
-
-
-
- PECL mongo 1.2.11
- Emits E_DEPRECATED when used.
-
-
-
-
-
-
-
-
-
diff --git a/reference/mongo/mongodb/get.xml b/reference/mongo/mongodb/get.xml
deleted file mode 100644
index d0cf059899..0000000000
--- a/reference/mongo/mongodb/get.xml
+++ /dev/null
@@ -1,76 +0,0 @@
-
-
-
-
-
- MongoDB::__get
- Gets a collection
-
-
- &reftitle.description;
-
- publicMongoCollectionMongoDB::__get
- stringname
-
-
- This is the easiest way of getting a collection from a database object. If a
- collection name contains strange characters, you may have to use
- MongoDB::selectCollection instead.
-
-selectDB("foo")->selectCollection("bar");
-$collection = $mongo->foo->bar;
-
-?>
-]]>
-
-
-
-
- &reftitle.parameters;
-
-
-
-
- name
-
-
-
- The name of the collection.
-
-
-
-
-
-
-
- &reftitle.returnvalues;
-
- Returns the collection.
-
-
-
-
diff --git a/reference/mongo/mongodb/getcollectioninfo.xml b/reference/mongo/mongodb/getcollectioninfo.xml
deleted file mode 100644
index 3ea9eba50d..0000000000
--- a/reference/mongo/mongodb/getcollectioninfo.xml
+++ /dev/null
@@ -1,145 +0,0 @@
-
-
-
-
-
- MongoDB::getCollectionInfo
- Returns information about collections in this database
-
-
-
- &reftitle.description;
-
- publicarrayMongoDB::getCollectionInfo
- arrayoptionsarray()
-
-
- Gets a list of all collections in the database and returns them as an array
- of documents, which contain their names and options.
-
- &mongo.listcollections.note;
-
-
-
- &reftitle.parameters;
-
-
-
- options
-
-
-
- An array of options for listing the collections. Currently available
- options include:
-
- &mongo.listcollections.parameters.filter;
- &mongo.listcollections.parameters.includesystemcollections;
-
-
-
- The following option may be used with MongoDB 2.8+:
-
- &mongo.command.parameters.maxtimems;
-
-
-
-
-
-
-
-
- &reftitle.returnvalues;
-
- This function returns an array where each element is an array describing a
- collection. Elements will contain a name key denoting the
- name of the collection, and optionally contain an options
- key denoting an array of objects used to create the collection. For example,
- capped collections will include capped and
- size options.
-
-
-
-
- &reftitle.errors;
-
- For MongoDB 2.6 and earlier, MongoException will be
- thrown if a non-string value was specified for the
- "filter" option's "name" criteria.
-
-
-
-
- &reftitle.examples;
-
- MongoDB::getCollectionInfo example
-
-selectDB("demo");
-var_dump($db->getCollectionInfo());
-?>
-]]>
-
- &example.outputs.similar;
-
-
- array(2) {
- ["name"]=>
- string(4) "logs"
- ["options"]=>
- array(2) {
- ["capped"]=>
- bool(true)
- ["size"]=>
- int(10240)
- }
- }
- [1]=>
- array(2) {
- ["name"]=>
- string(5) "users"
- ["options"]=>
- array(1) {
- ["flags"]=>
- int(1)
- }
- }
-}
-]]>
-
-
-
-
-
- &reftitle.seealso;
-
-
- MongoDB::getCollectionNames
- MongoDB::listCollections
-
-
-
-
-
-
diff --git a/reference/mongo/mongodb/getcollectionnames.xml b/reference/mongo/mongodb/getcollectionnames.xml
deleted file mode 100644
index 1f4fb67b6b..0000000000
--- a/reference/mongo/mongodb/getcollectionnames.xml
+++ /dev/null
@@ -1,151 +0,0 @@
-
-
-
-
-
- MongoDB::getCollectionNames
- Gets an array of names for all collections in this database
-
-
-
- &reftitle.description;
-
- publicarrayMongoDB::getCollectionNames
- arrayoptionsarray()
-
-
- Gets a list of all collections in the database and returns their names as an
- array of strings.
-
- &mongo.listcollections.note;
-
-
-
- &reftitle.parameters;
-
-
-
- options
-
-
-
- An array of options for listing the collections. Currently available
- options include:
-
- &mongo.listcollections.parameters.filter;
- &mongo.listcollections.parameters.includesystemcollections;
-
-
-
- The following option may be used with MongoDB 2.8+:
-
- &mongo.command.parameters.maxtimems;
-
-
-
-
-
-
-
-
- &reftitle.returnvalues;
-
- Returns the collection names as an array of strings.
-
-
-
-
- &reftitle.errors;
-
- For MongoDB 2.6 and earlier, MongoException will be
- thrown if a non-string value was specified for the
- "filter" option's "name" criteria.
-
-
-
-
- &reftitle.changelog;
-
-
-
-
- &Version;
- &Description;
-
-
-
-
- PECL mongo 1.6.0
-
- Changed first parameter to be an array of options. Pre-1.6.0, the
- first parameter was a boolean indicating the
- "includeSystemCollections" option.
-
-
-
-
-
-
-
-
- &reftitle.examples;
-
- MongoDB::getCollectionNames example
-
-selectDB("demo");
-$collections = $db->getCollectionNames();
-
-foreach ($collections as $collectionName) {
- echo "Found collection: ", $collectionName, "\n";
-}
-?>
-]]>
-
- &example.outputs.similar;
-
-
-
-
-
-
-
- &reftitle.seealso;
-
-
- MongoDB::listCollections
- MongoDB::getCollectionInfo
-
-
-
-
-
-
-
diff --git a/reference/mongo/mongodb/getdbref.xml b/reference/mongo/mongodb/getdbref.xml
deleted file mode 100644
index ab7e7c6ceb..0000000000
--- a/reference/mongo/mongodb/getdbref.xml
+++ /dev/null
@@ -1,87 +0,0 @@
-
-
-
-
-
- MongoDB::getDBRef
- Fetches the document pointed to by a database reference
-
-
-
- &reftitle.description;
-
- publicarrayMongoDB::getDBRef
- arrayref
-
-
-
-
- &reftitle.parameters;
-
-
-
-
- ref
-
-
-
- A database reference.
-
-
-
-
-
-
-
-
- &reftitle.returnvalues;
-
- Returns the document pointed to by the reference.
-
-
-
- &reftitle.examples;
-
- MongoDB::getDBRef example
-
- Example demonstrating how to get a database reference and what the expected
- input is.
-
-
- 'profiles',
- '$id' => new MongoId('47cc67093475061e3d9536d2')
- );
-
- $profile = $db->getDBRef($ref);
- ?>
- ]]>
-
-
- See MongoDB::createDBRef for more information about how to programatically create DB references.
-
-
-
-
-
diff --git a/reference/mongo/mongodb/getgridfs.xml b/reference/mongo/mongodb/getgridfs.xml
deleted file mode 100644
index 1060a7eb98..0000000000
--- a/reference/mongo/mongodb/getgridfs.xml
+++ /dev/null
@@ -1,85 +0,0 @@
-
-
-
-
-
- MongoDB::getGridFS
- Fetches toolkit for dealing with files stored in this database
-
-
-
- &reftitle.description;
-
- publicMongoGridFSMongoDB::getGridFS
- stringprefix"fs"
-
-
-
-
- &reftitle.parameters;
-
-
-
-
- prefix
-
-
-
- The prefix for the files and chunks collections.
-
-
-
-
-
-
-
-
- &reftitle.returnvalues;
-
- Returns a new gridfs object for this database.
-
-
-
-
- &reftitle.examples;
-
- MongoDB::getGridFS example
- This example demonstrates how get a MongoGridFS instance.
-
-my_db;
-
-$prefix = 'files';
-$collection = $db->getGridFS($prefix);
-
-?>
-]]>
-
-
- Read more about the MongoGridFS to learn how to store files with MongoDB.
-
-
-
-
-
-
diff --git a/reference/mongo/mongodb/getprofilinglevel.xml b/reference/mongo/mongodb/getprofilinglevel.xml
deleted file mode 100644
index e156f876d8..0000000000
--- a/reference/mongo/mongodb/getprofilinglevel.xml
+++ /dev/null
@@ -1,83 +0,0 @@
-
-
-
-
-
- MongoDB::getProfilingLevel
- Gets this database's profiling level
-
-
-
- &reftitle.description;
-
- publicintMongoDB::getProfilingLevel
-
-
-
- This returns the current database profiling level.
-
-
- The database profiler tracks query execution times. If you turn it on (say,
- using MongoDB::setProfilingLevel or the shell), you can
- see how many queries took longer than a given number of milliseconds or the
- timing for all queries.
-
-
- Note that profiling slows down queries, so it is better to use in development
- or testing than in a time-sensitive application.
-
-
- This function is equivalent to running:
-
-command(array('profile' => -1));
-}
-
-?>
-]]>
-
-
-
-
-
- &reftitle.parameters;
- &no.function.parameters;
-
-
-
- &reftitle.returnvalues;
-
- Returns the profiling level.
-
-
-
-
- &reftitle.seealso;
-
- MongoDB core docs on profiling
- MongoDB::setProfilingLevel
-
-
-
-
diff --git a/reference/mongo/mongodb/getreadpreference.xml b/reference/mongo/mongodb/getreadpreference.xml
deleted file mode 100644
index 633f0cdc48..0000000000
--- a/reference/mongo/mongodb/getreadpreference.xml
+++ /dev/null
@@ -1,135 +0,0 @@
-
-
-
-
-
- MongoDB::getReadPreference
- Get the read preference for this database
-
-
-
- &reftitle.description;
-
- publicarrayMongoDB::getReadPreference
-
-
-
-
-
- &reftitle.parameters;
- &no.function.parameters;
-
-
-
- &reftitle.returnvalues;
- &mongo.getreadpreference.returnvalues;
-
-
-
- &reftitle.changelog;
-
-
-
-
-
- &Version;
- &Description;
-
-
-
-
- PECL mongo 1.3.3
-
- The return value has changed to be consistent with
- MongoDB::setReadPreference. The
- type value was changed from a number to a string,
- type_string was removed, and
- tagsets now expresses tags as key/value pairs instead
- of colon-delimited strings.
-
-
-
-
-
-
-
-
-
- &reftitle.examples;
-
- MongoDB::getReadPreference return value example
-
-test;
-$db->setReadPreference(MongoClient::RP_SECONDARY, array(
- array('dc' => 'east', 'use' => 'reporting'),
- array('dc' => 'west'),
- array(),
-));
-var_dump($db->getReadPreference());
-?>
-]]>
-
- &example.outputs;
-
-
- string(9) "secondary"
- ["tagsets"]=>
- array(3) {
- [0]=>
- array(2) {
- ["dc"]=>
- string(4) "east"
- ["use"]=>
- string(9) "reporting"
- }
- [1]=>
- array(1) {
- ["dc"]=>
- string(7) "west"
- }
- [2]=>
- array(0) {
- }
- }
-}
-]]>
-
-
-
-
-
- &reftitle.seealso;
-
- The read preferences documentation.
- MongoDB::setReadPreference
-
-
-
-
-
-
diff --git a/reference/mongo/mongodb/getslaveokay.xml b/reference/mongo/mongodb/getslaveokay.xml
deleted file mode 100644
index 89290f9ee4..0000000000
--- a/reference/mongo/mongodb/getslaveokay.xml
+++ /dev/null
@@ -1,86 +0,0 @@
-
-
-
-
-
- MongoDB::getSlaveOkay
- Get slaveOkay setting for this database
-
-
-
- &reftitle.description;
-
- publicboolMongoDB::getSlaveOkay
-
-
-
-
- See the query section of this manual for
- information on distributing reads to secondaries.
-
-
-
-
- &reftitle.parameters;
- &no.function.parameters;
-
-
-
- &reftitle.returnvalues;
-
- Returns the value of slaveOkay for this instance.
-
-
-
-
- &reftitle.changelog;
-
-
-
-
-
- &Version;
- &Description;
-
-
-
-
- PECL mongo 1.2.11
- Emits E_DEPRECATED when used.
-
-
-
-
-
-
-
-
- &reftitle.seealso;
-
-
- MongoDB::getReadPreference
- MongoDB::setReadPreference
-
-
-
-
-
-
diff --git a/reference/mongo/mongodb/getwriteconcern.xml b/reference/mongo/mongodb/getwriteconcern.xml
deleted file mode 100644
index 2032a85e6a..0000000000
--- a/reference/mongo/mongodb/getwriteconcern.xml
+++ /dev/null
@@ -1,94 +0,0 @@
-
-
-
-
-
- MongoDB::getWriteConcern
- Get the write concern for this database
-
-
-
- &reftitle.description;
-
- publicarrayMongoDB::getWriteConcern
-
-
-
-
-
- &reftitle.parameters;
- &no.function.parameters;
-
-
-
- &reftitle.returnvalues;
- &mongo.getwriteconcern.returnvalues;
-
-
-
- &reftitle.examples;
-
- MongoDB::getWriteConcern return value example
-
- 500));
-$db = $mc->selectDB('test');
-var_dump($db->getWriteConcern());
-
-$db->setWriteConcern(1, 1000);
-var_dump($db->getWriteConcern());
-?>
-]]>
-
- &example.outputs;
-
-
- int(1)
- ["wtimeout"]=>
- int(500)
-}
-array(2) {
- ["w"]=>
- int(1)
- ["wtimeout"]=>
- int(1000)
-}
-]]>
-
-
-
-
-
- &reftitle.seealso;
-
- The write concern documentation.
- MongoDB::setWriteConcern
-
-
-
-
-
-
diff --git a/reference/mongo/mongodb/lasterror.xml b/reference/mongo/mongodb/lasterror.xml
deleted file mode 100644
index 7a0599cb84..0000000000
--- a/reference/mongo/mongodb/lasterror.xml
+++ /dev/null
@@ -1,119 +0,0 @@
-
-
-
-
-
- MongoDB::lastError
- Check if there was an error on the most recent db operation performed
-
-
-
- &reftitle.description;
-
- publicarrayMongoDB::lastError
-
-
-
- This method is equivalent to:
-
-command(array('getlasterror' => 1));
-}
-
-?>
-]]>
-
-
-
-
-
- &reftitle.parameters;
- &no.function.parameters;
-
-
-
- &reftitle.returnvalues;
-
- Returns the error, if there was one.
-
-
-
-
- &reftitle.examples;
-
- MongoDB::lastError &null; error example
-
-resetError();
-var_dump($db->lastError());
-?>
-]]>
-
- &example.outputs.similar;
-
-
- NULL
- ["n"]=>
- int(0)
- ["ok"]=>
- float(1)
-}
-]]>
-
-
-
- MongoDB::lastError duplicate key example
-
-selectCollection("foo");
-
-// insert two documents with the same _id
-$c->insert(array("_id" => 1));
-$c->insert(array("_id" => 1));
-
-var_dump($db->lastError());
-?>
-]]>
-
- &example.outputs.similar;
-
-
- string(64) "E11000 duplicate key errorindex: foo.foo.$_id_ dup key: { : 1 }"
- ["n"]=>
- int(0)
- ["ok"]=>
- float(1)
-}
-]]>
-
-
-
-
-
diff --git a/reference/mongo/mongodb/listcollections.xml b/reference/mongo/mongodb/listcollections.xml
deleted file mode 100644
index c8bf548cdb..0000000000
--- a/reference/mongo/mongodb/listcollections.xml
+++ /dev/null
@@ -1,160 +0,0 @@
-
-
-
-
-
- MongoDB::listCollections
- Gets an array of MongoCollection objects for all collections in this database
-
-
-
- &reftitle.description;
-
- publicarrayMongoDB::listCollections
- arrayoptionsarray()
-
-
- Gets a list of all collections in the database and returns them as an array
- of MongoCollection objects.
-
- &mongo.listcollections.note;
-
-
-
- &reftitle.parameters;
-
-
-
- options
-
-
-
- An array of options for listing the collections. Currently available
- options include:
-
- &mongo.listcollections.parameters.filter;
- &mongo.listcollections.parameters.includesystemcollections;
-
-
-
- The following option may be used with MongoDB 2.8+:
-
- &mongo.command.parameters.maxtimems;
-
-
-
-
-
-
-
-
- &reftitle.returnvalues;
-
- Returns an array of MongoCollection objects.
-
-
-
-
- &reftitle.errors;
-
- For MongoDB 2.6 and earlier, MongoException will be
- thrown if a non-string value was specified for the
- "filter" option's "name" criteria.
-
-
-
-
- &reftitle.changelog;
-
-
-
-
- &Version;
- &Description;
-
-
-
-
- PECL mongo 1.6.0
-
- Changed first parameter to be an array of options. Pre-1.6.0, the
- first parameter was a boolean indicating the
- "includeSystemCollections" option.
-
-
-
- PECL mongo 1.3.0
-
- Added the includeSystemCollections parameter.
-
-
-
-
-
-
-
-
- &reftitle.examples;
-
- MongoDB::listCollections example
-
- The following example demonstrates running count on each collection in a database.
-
-
-selectDB("demo");
-$collections = $db->listCollections();
-
-foreach ($collections as $collection) {
- echo "amount of documents in $collection: ";
- echo $collection->count(), "\n";
-}
-
-?>
-]]>
-
- &example.outputs.similar;
-
-
-
-
-
-
-
- &reftitle.seealso;
-
-
- MongoDB::getCollectionNames
- MongoDB::getCollectionInfo
-
-
-
-
-
diff --git a/reference/mongo/mongodb/preverror.xml b/reference/mongo/mongodb/preverror.xml
deleted file mode 100644
index 8cf09e0800..0000000000
--- a/reference/mongo/mongodb/preverror.xml
+++ /dev/null
@@ -1,77 +0,0 @@
-
-
-
-
-
- MongoDB::prevError
- Checks for the last error thrown during a database operation
-
-
-
- &reftitle.description;
-
- publicarrayMongoDB::prevError
-
-
-
- MongoDB::lastError is usually preferred to this. This
- method returns the last database error that occurred and how many operations
- ago it occurred. It is mostly deprecated.
-
-
-
-
- &reftitle.parameters;
- &no.function.parameters;
-
-
-
- &reftitle.returnvalues;
-
- Returns the error and the number of operations ago it occurred.
-
-
-
-
- &reftitle.changelog;
-
-
-
-
-
- &Version;
- &Description;
-
-
-
-
- PECL mongo 1.2.11
- Emits E_DEPRECATED when used.
-
-
-
-
-
-
-
-
-
-
diff --git a/reference/mongo/mongodb/repair.xml b/reference/mongo/mongodb/repair.xml
deleted file mode 100644
index b67a825f88..0000000000
--- a/reference/mongo/mongodb/repair.xml
+++ /dev/null
@@ -1,131 +0,0 @@
-
-
-
-
-
- MongoDB::repair
- Repairs and compacts this database
-
-
-
- &reftitle.description;
-
- publicarrayMongoDB::repair
- boolpreserve_cloned_files&false;
- boolbackup_original_files&false;
-
-
- This creates a fresh copy of all database data. It will remove any corrupt
- data and compact and large stretches of free space it finds. This is a very
- slow operation on a large database.
-
-
- This is usually run from the shell or the command line, not the driver.
-
-
- It is equivalent to the function:
-
-command(array('repairDatabase' => 1));
-}
-
-?>
-]]>
-
-
-
-
-
- &reftitle.parameters;
-
-
-
-
- preserve_cloned_files
-
-
-
- If cloned files should be kept if the repair fails.
-
-
-
-
-
- backup_original_files
-
-
-
- If original files should be backed up.
-
-
-
-
-
-
-
-
- &reftitle.returnvalues;
-
- Returns db response.
-
-
-
-
- &reftitle.seealso;
-
- MongoDB core docs on repairDatabase.
-
-
-
-
- &reftitle.examples;
-
- MongoDB::repair example
- This example demonstrates how to repare and compact a database.
-
-foo;
-
-$response = $db->repair();
-print_r($response);
-
-?>
-]]>
-
- &example.outputs.similar;
-
- 1
-)
-]]>
-
-
-
-
-
-
diff --git a/reference/mongo/mongodb/reseterror.xml b/reference/mongo/mongodb/reseterror.xml
deleted file mode 100644
index d13f564997..0000000000
--- a/reference/mongo/mongodb/reseterror.xml
+++ /dev/null
@@ -1,90 +0,0 @@
-
-
-
-
-
- MongoDB::resetError
- Clears any flagged errors on the database
-
-
-
- &reftitle.description;
-
- publicarrayMongoDB::resetError
-
-
-
- This method is not used in normal operations. It resets the database error
- tracker (which can be incremented with
- MongoDB::forceError, also not normally used).
-
-
- It is equivalent to running:
-
-command(array('reseterror' => 1));
-}
-
-?>
-]]>
-
-
-
-
-
- &reftitle.parameters;
- &no.function.parameters;
-
-
-
- &reftitle.returnvalues;
-
- Returns the database response.
-
-
-
-
- &reftitle.changelog;
-
-
-
-
-
- &Version;
- &Description;
-
-
-
-
- PECL mongo 1.2.11
- Emits E_DEPRECATED when used.
-
-
-
-
-
-
-
-
-
diff --git a/reference/mongo/mongodb/selectcollection.xml b/reference/mongo/mongodb/selectcollection.xml
deleted file mode 100644
index 656e9af710..0000000000
--- a/reference/mongo/mongodb/selectcollection.xml
+++ /dev/null
@@ -1,68 +0,0 @@
-
-
-
-
-
- MongoDB::selectCollection
- Gets a collection
-
-
- &reftitle.description;
-
- publicMongoCollectionMongoDB::selectCollection
- stringname
-
-
-
-
- &reftitle.parameters;
-
-
-
-
- name
-
-
-
- The collection name.
-
-
-
-
-
-
-
-
- &reftitle.returnvalues;
-
- Returns a new collection object.
-
-
-
-
- &reftitle.errors;
-
- Throws Exception if the collection name is invalid.
-
-
-
-
-
diff --git a/reference/mongo/mongodb/setprofilinglevel.xml b/reference/mongo/mongodb/setprofilinglevel.xml
deleted file mode 100644
index b6234c020a..0000000000
--- a/reference/mongo/mongodb/setprofilinglevel.xml
+++ /dev/null
@@ -1,106 +0,0 @@
-
-
-
-
-
- MongoDB::setProfilingLevel
- Sets this database's profiling level
-
-
-
- &reftitle.description;
-
- publicintMongoDB::setProfilingLevel
- intlevel
-
-
- This changes the current database profiling level.
-
-
- This function is equivalent to running:
-
-command(array('profile' => $level));
-}
-
-?>
-]]>
-
-
-
- The options for level are 0 (off), 1 (queries > 100ms), and 2 (all queries).
- If you would like to profile queries that take longer than another time
- period, use the database command and pass it a second option, the number of
- milliseconds. For example, to profile all queries that take longer than one
- second, run:
-
-command(array('profile' => 1, 'slowms' => 1000));
-
-?>
-]]>
-
-
-
- Profiled queries will appear in the system.profile
- collection of this database.
-
-
-
-
- &reftitle.parameters;
-
-
-
-
- level
-
-
-
- Profiling level.
-
-
-
-
-
-
-
-
- &reftitle.returnvalues;
-
- Returns the previous profiling level.
-
-
-
-
- &reftitle.seealso;
-
- MongoDB core docs on profiling
- MongoDB::getProfilingLevel
-
-
-
-
diff --git a/reference/mongo/mongodb/setreadpreference.xml b/reference/mongo/mongodb/setreadpreference.xml
deleted file mode 100644
index a99cbc3627..0000000000
--- a/reference/mongo/mongodb/setreadpreference.xml
+++ /dev/null
@@ -1,86 +0,0 @@
-
-
-
-
-
- MongoDB::setReadPreference
- Set the read preference for this database
-
-
-
- &reftitle.description;
-
- publicboolMongoDB::setReadPreference
- stringread_preference
- arraytags
-
-
-
-
- &reftitle.parameters;
- &mongo.setreadpreference.parameters;
-
-
-
- &reftitle.returnvalues;
- &mongo.setreadpreference.returnvalues;
-
-
-
- &reftitle.errors;
- &mongo.setreadpreference.errors;
-
-
-
- &reftitle.examples;
-
- MongoDB::setReadPreference tag set array syntax example
-
-test;
-
-// Prefer the nearest server in the "east" data center also used for reporting,
-// but fall back to a server in the "west" data center
-$db->setReadPreference(MongoClient::RP_NEAREST, array(
- array('dc' => 'east', 'use' => 'reporting'),
- array('dc' => 'west'),
-));
-?>
-]]>
-
-
-
-
-
- &reftitle.seealso;
-
- The read preferences documentation.
- MongoDB::getReadPreference
-
-
-
-
-
-
diff --git a/reference/mongo/mongodb/setslaveokay.xml b/reference/mongo/mongodb/setslaveokay.xml
deleted file mode 100644
index af3a6c9b4d..0000000000
--- a/reference/mongo/mongodb/setslaveokay.xml
+++ /dev/null
@@ -1,100 +0,0 @@
-
-
-
-
-
- MongoDB::setSlaveOkay
- Change slaveOkay setting for this database
-
-
-
- &reftitle.description;
-
- publicboolMongoDB::setSlaveOkay
- boolok&true;
-
-
-
- See the query section of this manual for
- information on distributing reads to secondaries.
-
-
-
-
- &reftitle.parameters;
-
-
-
-
- ok
-
-
-
- If reads should be sent to secondary members of a replica set for all
- possible queries using this MongoDB instance.
-
-
-
-
-
-
-
-
- &reftitle.returnvalues;
-
- Returns the former value of slaveOkay for this instance.
-
-
-
-
- &reftitle.changelog;
-
-
-
-
-
- &Version;
- &Description;
-
-
-
-
- PECL mongo 1.2.11
- Emits E_DEPRECATED when used.
-
-
-
-
-
-
-
-
- &reftitle.seealso;
-
-
- MongoDB::setReadPreference
- MongoDB::getReadPreference
-
-
-
-
-
-
diff --git a/reference/mongo/mongodb/setwriteconcern.xml b/reference/mongo/mongodb/setwriteconcern.xml
deleted file mode 100644
index 895e0d2b73..0000000000
--- a/reference/mongo/mongodb/setwriteconcern.xml
+++ /dev/null
@@ -1,83 +0,0 @@
-
-
-
-
-
- MongoDB::setWriteConcern
- Set the write concern for this database
-
-
-
- &reftitle.description;
-
- publicboolMongoDB::setWriteConcern
- mixedw
- intwtimeout
-
-
-
-
- &reftitle.parameters;
- &mongo.setwriteconcern.parameters;
-
-
-
- &reftitle.returnvalues;
- &mongo.setwriteconcern.returnvalues;
-
-
-
- &reftitle.errors;
- &mongo.setwriteconcern.errors;
-
-
-
- &reftitle.examples;
-
- MongoDB::setWriteConcern example
-
-selectDB('test');
-
-// Require that the majority of servers in the replica set acknowledge writes
-// within three seconds.
-$db->setWriteConcern('majority', 3000);
-?>
-]]>
-
-
-
-
-
- &reftitle.seealso;
-
- The write concern documentation.
- MongoDB::getWriteConcern
-
-
-
-
-
-
diff --git a/reference/mongo/mongodb/tostring.xml b/reference/mongo/mongodb/tostring.xml
deleted file mode 100644
index ae103de469..0000000000
--- a/reference/mongo/mongodb/tostring.xml
+++ /dev/null
@@ -1,48 +0,0 @@
-
-
-
-
-
- MongoDB::__toString
- The name of this database
-
-
-
- &reftitle.description;
-
- publicstringMongoDB::__toString
-
-
-
-
-
- &reftitle.parameters;
- &no.function.parameters;
-
-
-
- &reftitle.returnvalues;
-
- Returns this database's name.
-
-
-
-
diff --git a/reference/mongo/mongodbref.xml b/reference/mongo/mongodbref.xml
deleted file mode 100644
index 8fc3d9627f..0000000000
--- a/reference/mongo/mongodbref.xml
+++ /dev/null
@@ -1,164 +0,0 @@
-
-
-
-
-
- The MongoDBRef class
- MongoDBRef
-
-
-
-
- &mongo.noalternative.class.note;
-
- The concept of database references, and hence this class, has been
- deprecated in the database.
-
-
-
-
-
- &reftitle.intro;
-
- This class can be used to create lightweight links between objects in
- different collections.
-
-
- Motivation: Suppose we need to refer to a document in
- another collection. The easiest way is to create a field in the current
- document. For example, if we had a "people" collection and an "addresses"
- collection, we might want to create a link between each person document and
- an address document:
-
- Linking documents
-
-people;
-$addresses = $db->addresses;
-
-$myAddress = array("line 1" => "123 Main Street",
- "line 2" => null,
- "city" => "Springfield",
- "state" => "Vermont",
- "country" => "USA");
-
-// save the address
-$addresses->insert($myAddress);
-
-// save a person with a reference to the address
-$me = array("name" => "Fred", "address" => $myAddress['_id']);
-$people->insert($me);
-
-?>
-]]>
-
-
-
-
- Then, later on, we can find the person's address by querying the "addresses"
- collection with the MongoId we saved in the "people"
- collection.
-
-
- Suppose now that we have a more general case, where we don't know which
- collection (or even which database) contains the referenced document.
- MongoDBRef is a good choice for this case, as it is a
- common format that all of the drivers and the database understand.
-
-
- If each person had a list of things they liked which could come from
- multiple collections, such as "hobbies", "sports", "books", etc., we could
- use MongoDBRefs to keep track of what "like" went
- with what collection:
-
- Creating MongoDBRef links
-
-selectCollection("people");
-
-// model trains are in the "hobbies" collection
-$trainRef = MongoDBRef::create("hobbies", $modelTrains['_id']);
-// soccer is in the "sports" collection
-$soccerRef = MongoDBRef::create("sports", $soccer['_id']);
-
-// now we'll know what collections the items in the "likes" array came from when
-// we retrieve this document
-$people->insert(array("name" => "Fred", "likes" => array($trainRef, $soccerRef)));
-
-?>
-]]>
-
-
-
-
- Database references can be thought of as hyperlinks: they give the unique
- address of another document, but they do not load it or automatically follow
- the link/reference.
-
-
- A database reference is just a normal associative array, not an instance of
- MongoDBRef, so this class is a little different than
- the other data type classes. This class contains exclusively static methods
- for manipulating database references.
-
-
-
-
-
- &reftitle.classsynopsis;
-
-
-
- MongoDBRef
-
-
-
-
- MongoDBRef
-
-
-
-
- &Methods;
-
-
-
-
-
-
-
- &reftitle.seealso;
-
- MongoDB core docs on databases references.
-
-
-
-
- &reference.mongo.entities.mongodbref;
-
-
-
-
diff --git a/reference/mongo/mongodbref/create.xml b/reference/mongo/mongodbref/create.xml
deleted file mode 100644
index 70675d0c42..0000000000
--- a/reference/mongo/mongodbref/create.xml
+++ /dev/null
@@ -1,138 +0,0 @@
-
-
-
-
-
- MongoDBRef::create
- Creates a new database reference
-
-
-
-
- &mongo.noalternative.class.note;
-
- The concept of database references, and hence this class, has been
- deprecated.
-
-
-
-
-
- &reftitle.description;
-
- publicstaticarrayMongoDBRef::create
- stringcollection
- mixedid
- stringdatabase
-
-
- If no database is given, the current database is used.
-
-
-
-
- &reftitle.parameters;
-
-
-
-
- collection
-
-
-
- Collection name (without the database name).
-
-
-
-
-
- id
-
-
-
- The _id field of the object to which to link.
-
-
-
-
-
- database
-
-
-
- Database name.
-
-
-
-
-
-
-
-
- &reftitle.returnvalues;
-
- Returns the reference.
-
-
-
-
- &reftitle.examples;
-
- MongoDBRef::create example
-
- This creates a database reference to a document in the
- addresses collection. The
- MongoCollection::getName function returns the name of
- the collection (not including the database name).
-
-
-addresses;
-$people = $db->people;
-
-// save $address so it has an _id
-$addresses->insert($address);
-
-// create a reference
-$ref = MongoDBRef::create($addresses->getName(), $address['_id']);
-
-// set the field in $person
-$person['address'] = $ref;
-$people->save($person);
-?>
-]]>
-
-
-
-
-
- &reftitle.seealso;
-
-
- MongoDB::createDBRef
- MongoCollection::createDBRef
-
-
-
-
-
-
diff --git a/reference/mongo/mongodbref/get.xml b/reference/mongo/mongodbref/get.xml
deleted file mode 100644
index 8e5b084c69..0000000000
--- a/reference/mongo/mongodbref/get.xml
+++ /dev/null
@@ -1,114 +0,0 @@
-
-
-
-
-
- MongoDBRef::get
- Fetches the object pointed to by a reference
-
-
-
-
- &mongo.noalternative.class.note;
-
- The concept of database references, and hence this class, has been
- deprecated.
-
-
-
-
-
- &reftitle.description;
-
- publicstaticarrayMongoDBRef::get
- MongoDBdb
- arrayref
-
-
-
-
- &reftitle.parameters;
-
-
-
-
- db
-
-
-
- Database to use.
-
-
-
-
-
- ref
-
-
-
- Reference to fetch.
-
-
-
-
-
-
-
-
- &reftitle.returnvalues;
-
- Returns the document to which the reference refers or &null; if the document
- does not exist (the reference is broken).
-
-
-
-
- &reftitle.examples;
-
- MongoCollection::createDBRef example
-
-findOne();
-
-// dereference the address
-$address = MongoDBRef::get($people->db, $person['address']);
-
-?>
-]]>
-
-
-
-
-
- &reftitle.seealso;
-
-
- MongoDB::getDBRef
- MongoCollection::getDBRef
-
-
-
-
-
-
diff --git a/reference/mongo/mongodbref/isref.xml b/reference/mongo/mongodbref/isref.xml
deleted file mode 100644
index de82a82bb7..0000000000
--- a/reference/mongo/mongodbref/isref.xml
+++ /dev/null
@@ -1,77 +0,0 @@
-
-
-
-
-
- MongoDBRef::isRef
- Checks if an array is a database reference
-
-
-
-
- &mongo.noalternative.class.note;
-
- The concept of database references, and hence this class, has been
- deprecated.
-
-
-
-
-
- &reftitle.description;
-
- publicstaticboolMongoDBRef::isRef
- mixedref
-
-
- This method does not actually follow the reference, so it does not determine if it is
- broken or not. It merely checks that ref is in valid
- database reference format (in that it is an object or array with $ref and $id
- fields).
-
-
-
-
- &reftitle.parameters;
-
-
-
-
- ref
-
-
-
- Array or object to check.
-
-
-
-
-
-
-
-
- &reftitle.returnvalues;
-
- &return.success;
-
-
-
-
diff --git a/reference/mongo/mongodeletebatch.xml b/reference/mongo/mongodeletebatch.xml
deleted file mode 100644
index 0603d348f3..0000000000
--- a/reference/mongo/mongodeletebatch.xml
+++ /dev/null
@@ -1,76 +0,0 @@
-
-
-
-
-
- The MongoDeleteBatch class
- MongoDeleteBatch
-
-
-
-
-
- &reftitle.intro;
-
- Constructs a batch of DELETE operations. See MongoWriteBatch.
-
-
-
-
-
- &reftitle.classsynopsis;
-
-
-
- MongoDeleteBatch
-
-
-
-
- MongoDeleteBatch
-
-
-
- extends
- MongoWriteBatch
-
-
-
-
- &Methods;
-
-
- &InheritedMethods;
-
-
-
-
-
-
-
-
-
- &reference.mongo.entities.mongodeletebatch;
-
-
-
-
diff --git a/reference/mongo/mongodeletebatch/construct.xml b/reference/mongo/mongodeletebatch/construct.xml
deleted file mode 100644
index fabddf4e5b..0000000000
--- a/reference/mongo/mongodeletebatch/construct.xml
+++ /dev/null
@@ -1,66 +0,0 @@
-
-
-
-
-
- MongoDeleteBatch::__construct
- Description
-
-
-
- &reftitle.description;
-
- publicMongoDeleteBatch::__construct
- MongoCollectioncollection
- arraywrite_options
-
-
- Constructs a batch of DELETE operations. See MongoWriteBatch.
-
-
-
-
-
- &reftitle.parameters;
-
-
- collection
- &mongo.mongowritebatch.collection.description;
-
-
- write_options
- &mongo.mongowritebatch.writeoptions.description;
-
-
-
-
-
- &reftitle.returnvalues;
-
- A new MongoDeleteBatch.
-
-
-
-
-
-
-
diff --git a/reference/mongo/mongoduplicatekeyexception.xml b/reference/mongo/mongoduplicatekeyexception.xml
deleted file mode 100644
index 5d742f2e84..0000000000
--- a/reference/mongo/mongoduplicatekeyexception.xml
+++ /dev/null
@@ -1,103 +0,0 @@
-
-
-
-
-
- The MongoDuplicateKeyException class
- MongoDuplicateKeyException
-
-
-
-
-
- &reftitle.intro;
-
- Thrown when attempting to insert a document into a collection which already contains the same values for the unique keys.
-
-
-
-
-
- &reftitle.classsynopsis;
-
-
-
- MongoDuplicateKeyException
-
-
-
-
- MongoDuplicateKeyException
-
-
-
- extends
- MongoWriteConcernException
-
-
-
- &InheritedProperties;
-
-
-
- &InheritedMethods;
-
-
-
-
-
-
-
-
- &reftitle.examples;
-
- Catching MongoDuplicateKeyException
-
-selectCollection("test", "test");
-
-$c->insert(array('_id' => 1));
-try {
- $c->insert(array('_id' => 1));
-} catch (MongoWriteConcernException $e) {
- echo $e->getMessage(), "\n";
-}
-?>
-]]>
-
- &examples.outputs.similar;
-
-
-
-
-
-
-
-
-
-
-
diff --git a/reference/mongo/mongoexception.xml b/reference/mongo/mongoexception.xml
deleted file mode 100644
index 1ae1c1920c..0000000000
--- a/reference/mongo/mongoexception.xml
+++ /dev/null
@@ -1,268 +0,0 @@
-
-
-
-
-
- The MongoException class
- MongoException
-
-
-
-
-
- &reftitle.intro;
-
- Default Mongo exception.
-
-
-
- This covers a bunch of different error conditions that may eventually be
- moved to more specific exceptions, but will always extend
- MongoException.
-
-
-
-
-
-
- The MongoSomething object has not been correctly initialized by its constructor
-
-
- Code: 0
-
-
- Probably your Mongo object is not connected to a database server.
-
-
-
-
-
- zero-length keys are not allowed, did you use $ with double quotes?
-
-
- Code: 1
-
-
- You tried to save "" as a key. You generally should not do this. "" can
- mess up subobject access and is used by MongoDB internally. However, if
- you really want, you can set
- mongo.allow_empty_keys
- to true in your php.ini file to override this sanity check. If you
- override this, it is highly recommended that you set error checking to
- strict to avoid string interpolation errors.
-
-
-
-
-
- '.' not allowed in key: <key>
-
-
- Code: 2
-
-
- You attempted to write a key with '.' in it, which is prohibited.
-
-
-
-
-
- insert too large: <size>, max: <max>
-
-
- Code: 3
-
-
- You're attempting to send too much data to the database at once: the
- database will only accept inserts up to a certain size (currently 16 MB).
-
-
-
-
-
- no elements in doc
-
-
- Code: 4
-
-
- You're attempting to save a document with no fields.
-
-
-
-
-
- size of BSON doc is <size> bytes, max <max>MB
-
-
- Code: 5
-
-
- You're attempting to save a document that is larger than MongoDB can save.
-
-
-
-
-
- no documents given
-
-
- Code: 6
-
-
- You're attempting to batch insert an empty array of documents.
-
-
-
-
-
- MongoCollection::group takes an array, object, or MongoCode key
-
-
- Code: 7
-
-
- Wrong type parameter send to MongoCollection::group.
-
-
-
-
-
- field names must be strings
-
-
- Code: 8
-
-
- You should format field selectors as
- array("field1" => 1, "field2" => 1, ..., "fieldN" => 1).
-
-
-
-
-
- invalid regex
-
-
- Code: 9
-
-
- The regex passed to MongoRegex is not of the
- correct form.
-
-
-
-
-
- MongoDBRef::get: $ref field must be a string
-
-
- Code: 10
-
-
-
-
-
- MongoDBRef::get: $db field must be a string
-
-
- Code: 11
-
-
-
-
-
- non-utf8 string: <str>
-
-
- Code: 12
-
-
- This error occurs if you attempt to send a non-utf8 string to the
- database. All strings going into the database should be UTF8. See php.ini
- options for the transition option of quieting this exception.
-
-
-
-
-
- mutex error: <err>
-
-
- Code: 13
-
-
- The driver uses mutexes for synchronizing requests and responses in
- multithreaded environments. This is a fairly serious error and may not
- have a stack trace. It's unusual and should be reported to maintainers
- with any system information and steps to reproduce that you can provide.
-
-
-
-
-
- index name too long: <len>, max <max> characters
-
-
- Code: 14
-
-
- Indexes with names longer than 128 characters cannot be created. If you
- get this error, you should use
- MongoCollection::ensureIndex's "name" option to
- create a shorter name for your index.
-
-
-
-
-
-
-
-
- &reftitle.classsynopsis;
-
-
-
- MongoException
-
-
-
-
- MongoException
-
-
- extends
- Exception
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/reference/mongo/mongoexecutiontimeoutexception.xml b/reference/mongo/mongoexecutiontimeoutexception.xml
deleted file mode 100644
index 0f73c9c7ed..0000000000
--- a/reference/mongo/mongoexecutiontimeoutexception.xml
+++ /dev/null
@@ -1,75 +0,0 @@
-
-
-
-
-
- The MongoExecutionTimeoutException class
- MongoExecutionTimeoutException
-
-
-
-
-
- &reftitle.intro;
-
- Thrown when a operation times out server side (i.e. in MongoDB).
-
-
- To configure the operation timeout threshold, use
- MongoCursor::maxTimeMS or the
- "maxTimeMS" command option.
-
-
-
-
-
- &reftitle.classsynopsis;
-
-
-
- MongoExecutionTimeoutException
-
-
-
-
- MongoExecutionTimeoutException
-
-
-
- extends
- MongoException
-
-
-
- &InheritedProperties;
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/reference/mongo/mongogridfs.xml b/reference/mongo/mongogridfs.xml
deleted file mode 100644
index 1ad46ac9d7..0000000000
--- a/reference/mongo/mongogridfs.xml
+++ /dev/null
@@ -1,292 +0,0 @@
-
-
-
-
-
- The MongoGridFS class
- MongoGridFS
-
-
-
-
-
- &reftitle.intro;
-
- Utilities for storing and retrieving files from the database.
-
-
-
- GridFS is a storage specification all supported drivers implement.
- Basically, it defines two collections: files, for file
- metadata, and chunks, for file content. If the file is
- large, it will automatically be split into smaller chunks and each chunk
- will be saved as a document in the chunks collection.
-
-
-
- Each document in the files collection contains the filename, upload date,
- and md5 hash. It also contains a unique _id field, which
- can be used to query the chunks collection for the file's content. Each
- document in the chunks collection contains a chunk of binary data, a
- files_id field that matches its file's
- _id, and the position of this chunk in the overall file.
-
-
-
- For example, the files document is something like:
-
- 123456789, "filename" => "foo.txt", "chunkSize" => 3, "length" => 12);
-?>
-]]>
-
- and the chunks documents look like:
-
- 123456789, "n" => 0, "data" => new MongoBinData("abc"));
-array("files_id" => 123456789, "n" => 1, "data" => new MongoBinData("def"));
-array("files_id" => 123456789, "n" => 2, "data" => new MongoBinData("ghi"));
-array("files_id" => 123456789, "n" => 3, "data" => new MongoBinData("jkl"));
-?>
-]]>
-
- Of course, the default chunk size is thousands of bytes, but that makes an unwieldy example.
-
-
-
-
- Inter-Language Compatibility
-
- You should be able to use any files created by MongoGridFS with any other
- drivers, and vice versa. However, some drivers expect that all metadata
- associated with a file be in a "metadata" field. If you're going to be
- using other languages, it's a good idea to wrap info you might want them to
- see in a "metadata" field. For example, instead of:
-
-
-storeFile("somefile.txt", array("date" => new MongoDate()));
-
-?>
-]]>
-
-
- use something like:
-
-
-storeFile("somefile.txt", array("metadata" => array("date" => new MongoDate())));
-
-?>
-]]>
-
-
-
-
- The MongoGridFS Family
-
-
- MongoGridFS represents the files and chunks
- collections. MongoGridFS extends MongoCollection,
- and an instance of MongoGridFS has access to all of
- MongoCollection methods, which act on the files
- collection:
-
-
-getGridFS();
-$grid->update(array("filename" => "foo"), $newObj); // update on the files collection
-
-?>
-]]>
-
-
-
-
-
- Another example of manipulating metadata:
-
-
-storeFile("game.tgz");
-$game = $grid->findOne();
-
-// add a downloads counter
-$game->file['downloads'] = 0;
-$grid->save($game->file);
-
-// increment the counter
-$grid->update(array("_id" => $id), array('$inc' => array("downloads" => 1)));
-
-?>
-]]>
-
-
-
-
-
- You can also access the chunks collection from an instance of
- MongoGridFS:
-
-
-chunks; // $chunks is a normal MongoCollection
-$chunks->insert(array("x" => 4));
-
-?>
-]]>
-
-
-
-
- There are some methods for MongoGridFS with the same
- name as MongoCollection methods, that behave
- slightly differently. For example, MongoGridFS::remove
- will remove any objects that match the criteria from the files collection
- and their content from the chunks collection.
-
-
-
- To store something new in GridFS, there are a couple options. If you have
- a filename, you can say:
-
-
-storeFile($filename, array("whatever" => "metadata", "you" => "want"));
-
-?>
-]]>
-
-
-
-
-
- If you have a string of bytes that isn't a file, you can also store that
- using MongoGridFS::storeBytes:
-
-
-storeBytes($bytes, array("whatever" => "metadata", "you" => "want"));
-
-?>
-]]>
-
-
-
-
-
- Querying a MongoGridFS collection returns a
- MongoGridFSCursor, which behaves like a normal
- MongoCursor except that it returns
- MongoGridFSFiles instead of associative arrays.
-
-
-
- MongoGridFSFiles can be written back to disc using
- MongoGridFSFile::write or retrieved in memory using
- MongoGridFSFile::getBytes. There is currently no
- method that automatically streams chunks, but it would be fairly easy to
- write by querying the $grid->chunks collection.
-
-
-
- MongoGridFSFile objects contain a field file which
- contains any file metadata.
-
-
-
-
-
- &reftitle.classsynopsis;
-
-
-
- MongoGridFS
-
-
-
-
- extends
- MongoCollection
-
-
-
-
- Fields
-
- public
- MongoCollection
- chunks
- &null;
-
-
- protected
- string
- filesName
- &null;
-
-
- protected
- string
- chunksName
- &null;
-
-
- &Methods;
-
-
-
-
-
-
-
- &reftitle.seealso;
-
- MongoDB core docs on GridFS
- LightCube Solutions blog post on saving user uploads
- LightCube Solutions blog post on adding metadata to files
-
-
-
-
- &reference.mongo.entities.mongogridfs;
-
-
-
-
diff --git a/reference/mongo/mongogridfs/construct.xml b/reference/mongo/mongogridfs/construct.xml
deleted file mode 100644
index aae73b99c2..0000000000
--- a/reference/mongo/mongogridfs/construct.xml
+++ /dev/null
@@ -1,78 +0,0 @@
-
-
-
-
-
- MongoGridFS::__construct
- Creates new file collections
-
-
- &reftitle.description;
-
- publicMongoGridFS::__construct
- MongoDBdb
- stringprefix"fs"
- mixedchunks"fs"
-
-
-
- Files as stored across two collections, the first containing file meta information, the
- second containing chunks of the actual file. By default, fs.files and fs.chunks are the
- collection names used.
-
-
- Use one argument to specify a prefix other than "fs":
-
- uses myfiles.files and myfiles.chunks collections.
-
-
-
-
- &reftitle.parameters;
-
-
-
-
- db
-
-
-
- Database.
-
-
-
-
-
- files
-
-
-
- Optional collection name prefix.
-
-
-
-
-
-
-
-
diff --git a/reference/mongo/mongogridfs/delete.xml b/reference/mongo/mongogridfs/delete.xml
deleted file mode 100644
index 823f951169..0000000000
--- a/reference/mongo/mongogridfs/delete.xml
+++ /dev/null
@@ -1,83 +0,0 @@
-
-
-
-
-
- MongoGridFS::delete
- Remove a file and its chunks from the database
-
-
-
- &reftitle.description;
-
- publicboolarrayMongoGridFS::delete
- mixedid
-
-
-
-
- MongoGridFS::delete is a convenience method for
- calling MongoGridFS::remove with specific
- criteria and default options
- parameters.
-
-
-
-
-
- &reftitle.parameters;
-
-
-
-
- id
-
-
-
- _id of the file to remove.
-
-
-
-
-
-
-
-
- &reftitle.returnvalues;
-
- Returns an array containing the status of the removal (with respect to the
- files collection) if a
- write concern is applied.
- Otherwise, returns &true;.
-
-
- Fields in the status array are described in the documentation for
- MongoCollection::insert.
-
-
-
-
- &reftitle.errors;
- &mongo.errors.exceptions.writeconcern;
-
-
-
-
diff --git a/reference/mongo/mongogridfs/drop.xml b/reference/mongo/mongogridfs/drop.xml
deleted file mode 100644
index 1efc6a25d8..0000000000
--- a/reference/mongo/mongogridfs/drop.xml
+++ /dev/null
@@ -1,49 +0,0 @@
-
-
-
-
-
- MongoGridFS::drop
- Drops the files and chunks collections
-
-
-
- &reftitle.description;
-
- publicarrayMongoGridFS::drop
-
-
-
-
-
- &reftitle.parameters;
- &no.function.parameters;
-
-
-
- &reftitle.returnvalues;
-
- The database response.
-
-
-
-
-
diff --git a/reference/mongo/mongogridfs/find.xml b/reference/mongo/mongogridfs/find.xml
deleted file mode 100644
index bf02a15518..0000000000
--- a/reference/mongo/mongogridfs/find.xml
+++ /dev/null
@@ -1,73 +0,0 @@
-
-
-
-
-
- MongoGridFS::find
- Queries for files
-
-
-
- &reftitle.description;
-
- publicMongoGridFSCursorMongoGridFS::find
- arrayqueryarray()
- arrayfieldsarray()
-
-
-
-
- &reftitle.parameters;
-
-
-
-
- query
-
-
-
- The query.
-
-
-
-
-
- fields
-
-
-
- Fields to return.
-
-
-
-
-
-
-
-
- &reftitle.returnvalues;
-
- A MongoGridFSCursor.
-
-
-
-
-
diff --git a/reference/mongo/mongogridfs/findone.xml b/reference/mongo/mongogridfs/findone.xml
deleted file mode 100644
index be42ab5bc5..0000000000
--- a/reference/mongo/mongogridfs/findone.xml
+++ /dev/null
@@ -1,125 +0,0 @@
-
-
-
-
-
- MongoGridFS::findOne
- Returns a single file matching the criteria
-
-
-
- &reftitle.description;
-
- publicMongoGridFSFileMongoGridFS::findOne
- mixedqueryarray()
- mixedfieldsarray()
-
-
-
-
- &reftitle.parameters;
-
-
-
-
- query
-
-
-
- The filename or criteria for which to search.
-
-
-
-
-
-
-
-
- &reftitle.returnvalues;
-
- Returns a MongoGridFSFile or &null;.
-
-
-
-
- &reftitle.examples;
-
- MongoGridFS::findOne example
-
- Example demonstrating how to find a single file from the MongoGridFS.
-
-
-my_db->getGridFS('downloads');
-
-$downloads->storeFile('filename.tgz');
-
-$download = $downloads->findOne('filename.tgz'); // instance of MongoGridFSFile
-
-print_r($download);
-?>
-]]>
-
-
- See MongoGridFSFile for more information about how to work with files.
-
- &example.outputs.similar;
-
- Array
- (
- [_id] => MongoId Object
- (
- )
-
- [filename] => filename.tgz
- [uploadDate] => MongoDate Object
- (
- [sec] => 1274288014
- [usec] => 467000
- )
-
- [chunkSize] => 262144
- [md5] => d41d8cd98f00b204e9800998ecf8427e
- )
-
- [gridfs:protected] => MongoGridFS Object
- (
- [chunks] => MongoCollection Object
- (
- )
-
- [filesName:protected] => downloads.files
- [chunksName:protected] => downloads.chunks
- )
-
-)
-]]>
-
-
-
-
-
-
diff --git a/reference/mongo/mongogridfs/get.xml b/reference/mongo/mongogridfs/get.xml
deleted file mode 100644
index 0fd5ed3708..0000000000
--- a/reference/mongo/mongogridfs/get.xml
+++ /dev/null
@@ -1,62 +0,0 @@
-
-
-
-
-
- MongoGridFS::get
- Retrieve a file from the database
-
-
-
- &reftitle.description;
-
- publicMongoGridFSFileMongoGridFS::get
- mixedid
-
-
-
-
- &reftitle.parameters;
-
-
-
-
- id
-
-
-
- _id of the file to find.
-
-
-
-
-
-
-
-
- &reftitle.returnvalues;
-
- Returns the file, if found, or &null;.
-
-
-
-
-
diff --git a/reference/mongo/mongogridfs/put.xml b/reference/mongo/mongogridfs/put.xml
deleted file mode 100644
index bf44306fb0..0000000000
--- a/reference/mongo/mongogridfs/put.xml
+++ /dev/null
@@ -1,111 +0,0 @@
-
-
-
-
-
- MongoGridFS::put
- Stores a file in the database
-
-
-
- &reftitle.description;
-
- publicmixedMongoGridFS::put
- stringfilename
- arraymetadataarray()
- arrayoptionsarray()
-
-
-
-
- MongoGridFS::put is an alias of MongoGridFS::storeFile.
-
-
-
-
-
- &reftitle.parameters;
-
-
-
-
- filename
-
-
-
- Name of the file to store.
-
-
-
-
-
- metadata
-
-
-
- Other metadata fields to include in the file document.
-
- &mongo.gridfs.store.metadata.note;
-
-
-
-
- options
-
-
-
- An array of options for the insert operations executed against the
- chunks and files collections. See
- MongoCollection::insert for documentation on these
- these options.
-
-
-
-
-
-
-
-
- &reftitle.returnvalues;
- &mongo.gridfs.store.return;
-
-
-
- &reftitle.errors;
-
- Throws MongoGridFSException if there is an error
- reading filename or inserting into the
- chunks or files collections.
-
-
-
-
- &reftitle.seealso;
-
- MongoGridFS::storeBytes
- MongoGridFS::storeFile
- MongoGridFS::storeUpload
- MongoDB core docs on GridFS
-
-
-
-
-
diff --git a/reference/mongo/mongogridfs/remove.xml b/reference/mongo/mongogridfs/remove.xml
deleted file mode 100644
index f3ab83edae..0000000000
--- a/reference/mongo/mongogridfs/remove.xml
+++ /dev/null
@@ -1,87 +0,0 @@
-
-
-
-
-
- MongoGridFS::remove
- Remove files and their chunks from the database
-
-
-
- &reftitle.description;
-
- publicboolarrayMongoGridFS::remove
- arraycriteriaarray()
- arrayoptionsarray()
-
-
-
-
- &reftitle.parameters;
-
-
-
-
- criteria
-
-
-
- The filename or criteria for which to search.
-
-
-
-
-
- options
-
-
-
- An array of options for the remove operations executed against the
- chunks and files collections. See
- MongoCollection::remove for documentation on these
- options.
-
-
-
-
-
-
-
-
- &reftitle.returnvalues;
-
- Returns an array containing the status of the removal (with respect to the
- files collection) if the "w" option is
- set. Otherwise, returns &true;.
-
-
- Fields in the status array are described in the documentation for
- MongoCollection::insert.
-
-
-
-
- &reftitle.errors;
- &mongo.errors.exceptions.writeconcern;
-
-
-
-
diff --git a/reference/mongo/mongogridfs/storebytes.xml b/reference/mongo/mongogridfs/storebytes.xml
deleted file mode 100644
index 08d87dc9b1..0000000000
--- a/reference/mongo/mongogridfs/storebytes.xml
+++ /dev/null
@@ -1,144 +0,0 @@
-
-
-
-
-
- MongoGridFS::storeBytes
- Stores a string of bytes in the database
-
-
-
- &reftitle.description;
-
- publicmixedMongoGridFS::storeBytes
- stringbytes
- arraymetadataarray()
- arrayoptionsarray()
-
-
-
-
- &reftitle.parameters;
-
-
-
-
- bytes
-
-
-
- String of bytes to store.
-
-
-
-
-
- metadata
-
-
-
- Other metadata fields to include in the file document.
-
- &mongo.gridfs.store.metadata.note;
-
-
-
-
- options
-
-
-
- An array of options for the insert operations executed against the
- chunks and files collections. See
- MongoCollection::insert for documentation on these
- these options.
-
-
-
-
-
-
-
-
- &reftitle.returnvalues;
- &mongo.gridfs.store.return;
-
-
-
- &reftitle.errors;
-
- Throws MongoGridFSException if there is an error
- inserting into the chunks or files
- collections.
-
-
-
-
- &reftitle.examples;
-
- MongoGridFS::storeBytes with additional metadata
-
-selectDB('test')->getGridFS();
-
-$bytes = 'abcdefghijklmnopqrstuvwxyz';
-$id = $gridfs->storeBytes($bytes, array('_id' => 'alphabet'));
-$gridfsFile = $gridfs->get($id);
-
-var_dump($gridfsFile->file);
-?>
-]]>
-
- &example.outputs.similar;
-
-
- string(8) "alphabet"
- ["uploadDate"]=>
- object(MongoDate)#7 (0) {
- }
- ["length"]=>
- int(26)
- ["chunkSize"]=>
- int(262144)
- ["md5"]=>
- string(32) "c3fcd3d76192e4007dfb496cca67e13b"
-}
-]]>
-
-
-
-
-
- &reftitle.seealso;
-
- MongoGridFS::put
- MongoGridFS::storeFile
- MongoGridFS::storeUpload
- MongoDB core docs on GridFS
-
-
-
-
-
diff --git a/reference/mongo/mongogridfs/storefile.xml b/reference/mongo/mongogridfs/storefile.xml
deleted file mode 100644
index f8c2b99e21..0000000000
--- a/reference/mongo/mongogridfs/storefile.xml
+++ /dev/null
@@ -1,148 +0,0 @@
-
-
-
-
-
- MongoGridFS::storeFile
- Stores a file in the database
-
-
-
- &reftitle.description;
-
- publicmixedMongoGridFS::storeFile
- stringresourcefilename
- arraymetadataarray()
- arrayoptionsarray()
-
-
-
-
- &reftitle.parameters;
-
-
-
-
- filename
-
-
-
- Name of the file or a readable stream to store.
-
-
-
-
-
- metadata
-
-
-
- Other metadata fields to include in the file document.
-
- &mongo.gridfs.store.metadata.note;
-
-
-
-
- options
-
-
-
- An array of options for the insert operations executed against the
- chunks and files collections. See
- MongoCollection::insert for documentation on these
- these options.
-
-
-
-
-
-
-
-
- &reftitle.returnvalues;
- &mongo.gridfs.store.return;
-
-
-
- &reftitle.errors;
-
- Throws MongoGridFSException if there is an error
- reading filename or inserting into the
- chunks or files collections.
-
-
-
-
- &reftitle.examples;
-
- MongoGridFS::storeFile with additional metadata
-
-selectDB('test')->getGridFS();
-
-$id = $gridfs->storeFile('example.txt', array('contentType' => 'plain/text'));
-$gridfsFile = $gridfs->get($id);
-
-var_dump($gridfsFile->file);
-?>
-]]>
-
- &example.outputs.similar;
-
-
- object(MongoId)#6 (0) {
- }
- ["contentType"]=>
- string(10) "plain/text"
- ["filename"]=>
- string(11) "example.txt"
- ["uploadDate"]=>
- object(MongoDate)#7 (0) {
- }
- ["length"]=>
- int(26)
- ["chunkSize"]=>
- int(262144)
- ["md5"]=>
- string(32) "c3fcd3d76192e4007dfb496cca67e13b"
-}
-]]>
-
-
-
-
-
- &reftitle.seealso;
-
- MongoGridFS::put
- MongoGridFS::storeBytes
- MongoGridFS::storeUpload
- MongoDB core docs on GridFS
-
-
-
-
-
diff --git a/reference/mongo/mongogridfs/storeupload.xml b/reference/mongo/mongogridfs/storeupload.xml
deleted file mode 100644
index ac9c141f35..0000000000
--- a/reference/mongo/mongogridfs/storeupload.xml
+++ /dev/null
@@ -1,167 +0,0 @@
-
-
-
-
-
- MongoGridFS::storeUpload
- Stores an uploaded file in the database
-
-
-
- &reftitle.description;
-
- publicmixedMongoGridFS::storeUpload
- stringname
- arraymetadata
-
-
-
-
- &reftitle.parameters;
-
-
-
-
- name
-
-
-
- The name of the uploaded file(s) to store. This should correspond to the
- file field's name attribute in the HTML form.
-
-
-
-
-
- metadata
-
-
-
- Other metadata fields to include in the file document.
-
- &mongo.gridfs.store.metadata.note;
-
-
- The filename field will be populated with the
- client's filename (e.g. $_FILES['foo']['name']).
-
-
-
-
-
-
-
-
-
- &reftitle.returnvalues;
- &mongo.gridfs.store.return;
-
-
- If multiple files are uploaded
- using the same field name, this method will not return anything;
- however, the files themselves will still be processed.
-
-
-
-
-
- &reftitle.errors;
-
- Throws MongoGridFSException if there is an error
- reading the uploaded file(s) or inserting into the chunks
- or files collections.
-
-
-
-
- &reftitle.changelog;
-
-
-
-
-
- &Version;
- &Description;
-
-
-
-
- PECL mongo 1.2.5
-
- Changed second parameter to an array of metadata. Pre-1.2.5, the
- second parameter was an optional string overriding the filename.
-
-
-
-
-
-
-
-
-
- &reftitle.examples;
-
- MongoGridFS::storeUpload HTML form example
-
- Suppose you have the following HTML form:
-
-
-
-
-
-
-
-
-
-
-
-]]>
-
-
- If you wanted to store the uploaded image in MongoDB, you could do the
- following in the script handling the form submission:
-
-
-selectDB('test')->getGridFS();
-
-$gridfs->storeUpload('pic', array('username' => $_POST['username']));
-?>
-]]>
-
-
-
-
-
- &reftitle.seealso;
-
- MongoGridFS::put
- MongoGridFS::storeBytes
- MongoGridFS::storeFile
- MongoDB core docs on GridFS
-
-
-
-
-
diff --git a/reference/mongo/mongogridfscursor.xml b/reference/mongo/mongogridfscursor.xml
deleted file mode 100644
index 0d042738f6..0000000000
--- a/reference/mongo/mongogridfscursor.xml
+++ /dev/null
@@ -1,76 +0,0 @@
-
-
-
-
-
- The MongoGridFSCursor class
- MongoGridFSCursor
-
-
-
-
-
- &reftitle.intro;
-
- Cursor for database file results.
-
-
-
-
-
- &reftitle.classsynopsis;
-
-
-
- MongoGridFSCursor
-
-
-
-
- extends
- MongoCursor
-
-
-
-
- Fields
-
- protected
- MongoGridFS
- gridfs
- &null;
-
-
- &Methods;
-
-
-
-
-
-
-
-
- &reference.mongo.entities.mongogridfscursor;
-
-
-
-
diff --git a/reference/mongo/mongogridfscursor/construct.xml b/reference/mongo/mongogridfscursor/construct.xml
deleted file mode 100644
index e76df22af6..0000000000
--- a/reference/mongo/mongogridfscursor/construct.xml
+++ /dev/null
@@ -1,106 +0,0 @@
-
-
-
-
-
- MongoGridFSCursor::__construct
- Create a new cursor
-
-
-
- &reftitle.description;
-
- publicMongoGridFSCursor::__construct
- MongoGridFSgridfs
- resourceconnection
- stringns
- arrayquery
- arrayfields
-
-
-
-
- &reftitle.parameters;
-
-
-
-
- gridfs
-
-
-
- Related GridFS collection.
-
-
-
-
-
- connection
-
-
-
- Database connection.
-
-
-
-
-
- ns
-
-
-
- Full name of database and collection.
-
-
-
-
-
- query
-
-
-
- Database query.
-
-
-
-
-
- fields
-
-
-
- Fields to return.
-
-
-
-
-
-
-
-
- &reftitle.returnvalues;
-
- Returns the new cursor.
-
-
-
-
-
diff --git a/reference/mongo/mongogridfscursor/current.xml b/reference/mongo/mongogridfscursor/current.xml
deleted file mode 100644
index 42a3dfd072..0000000000
--- a/reference/mongo/mongogridfscursor/current.xml
+++ /dev/null
@@ -1,48 +0,0 @@
-
-
-
-
-
- MongoGridFSCursor::current
- Returns the current file
-
-
-
- &reftitle.description;
-
- publicMongoGridFSFileMongoGridFSCursor::current
-
-
-
-
-
- &reftitle.parameters;
- &no.function.parameters;
-
-
-
- &reftitle.returnvalues;
-
- The current file.
-
-
-
-
diff --git a/reference/mongo/mongogridfscursor/getnext.xml b/reference/mongo/mongogridfscursor/getnext.xml
deleted file mode 100644
index fb143feca1..0000000000
--- a/reference/mongo/mongogridfscursor/getnext.xml
+++ /dev/null
@@ -1,48 +0,0 @@
-
-
-
-
-
- MongoGridFSCursor::getNext
- Return the next file to which this cursor points, and advance the cursor
-
-
-
- &reftitle.description;
-
- publicMongoGridFSFileMongoGridFSCursor::getNext
-
-
-
-
-
- &reftitle.parameters;
- &no.function.parameters;
-
-
-
- &reftitle.returnvalues;
-
- Returns the next file.
-
-
-
-
diff --git a/reference/mongo/mongogridfscursor/key.xml b/reference/mongo/mongogridfscursor/key.xml
deleted file mode 100644
index cd771497e0..0000000000
--- a/reference/mongo/mongogridfscursor/key.xml
+++ /dev/null
@@ -1,75 +0,0 @@
-
-
-
-
-
- MongoGridFSCursor::key
- Returns the current result's filename
-
-
-
- &reftitle.description;
-
- publicstringMongoGridFSCursor::key
-
-
-
-
-
- &reftitle.parameters;
- &no.function.parameters;
-
-
-
- &reftitle.returnvalues;
-
- The current result's _id as a string.
-
-
-
-
- &reftitle.changelog;
-
-
-
-
-
- &Version;
- &Description;
-
-
-
-
- PECL mongo 1.3.0
-
- The document's _id is returned as a string value,
- since the key should be unique. Pre-1.3.0, filename
- was returned.
-
-
-
-
-
-
-
-
-
-
diff --git a/reference/mongo/mongogridfsexception.xml b/reference/mongo/mongogridfsexception.xml
deleted file mode 100644
index 5e98736c1c..0000000000
--- a/reference/mongo/mongogridfsexception.xml
+++ /dev/null
@@ -1,178 +0,0 @@
-
-
-
-
-
- The MongoGridFSException class
- MongoGridFSException
-
-
-
-
-
- &reftitle.intro;
-
- Thrown when there are errors reading or writing files
- to or from the database.
-
-
-
-
-
- &reftitle.classsynopsis;
-
-
-
- MongoGridFSException
-
-
-
-
- MongoGridFSException
-
-
- extends
- MongoException
-
-
-
-
-
-
-
-
-
-
- Error codes
-
-
- MongoGridFSException error codes
-
-
-
- Code
- Message
- Reason
-
-
-
-
- 3
- Could not open file $filename
- Attempting to store an invalid file, such as directory
-
-
- 4
- File $filename is too large: $filesize bytes
- Maximum filesize in GridFS is 4GB
-
-
- 5
- could not find filehandle
- Resource doesn't have a filehandle
-
-
- 6
- no file is associate with this filehandle
- Resource isn't a file resource
-
-
- 7
- error setting up file: $filenames
- Could not open file for reading
-
-
- 9
- error reading file $filenames
- Failed reading file
-
-
- 10
- error reading filehandle
- Failed reading from a resource
-
-
- 11
- could not find uploaded file %s
- Filename doesn't seem to be uploaded file
-
-
- 12
- Couldn't find tmp_name in the $_FILES array. Are you sure the upload worked?
- Uploaded filename probably failed
-
-
- 13
- tmp_name was not a string or an array
- Invalid filename given
-
-
- 14
- couldn't find file size
- The length property is missing
-
-
- 15
- Cannot find filename
- No filename provided, and no filename property set
-
-
- 16
- could not open destination file %s
- Destination filename not writable
-
-
- 17
- error reading chunk of file
- Chunk corruption
-
-
- 18
- couldn't create a php_stream
- Couldn't create a stream resource
-
-
- 19
- couldn't find property
- Chunk corruption
-
-
- 20
- chunk number has wrong size (size) when the max is maxchunksize
- Chunk larger then expected
-
-
- 21
- chunk has wrong format
- Chunk corruption
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/reference/mongo/mongogridfsfile.xml b/reference/mongo/mongogridfsfile.xml
deleted file mode 100644
index 76c6671656..0000000000
--- a/reference/mongo/mongogridfsfile.xml
+++ /dev/null
@@ -1,81 +0,0 @@
-
-
-
-
-
- The MongoGridFSFile class
- MongoGridFSFile
-
-
-
-
-
- &reftitle.intro;
-
- A database file object.
-
-
-
-
-
- &reftitle.classsynopsis;
-
-
-
- MongoGridFSFile
-
-
-
-
- MongoGridFSFile
-
-
-
-
- Fields
-
- public
- array
- file
- &null;
-
-
- protected
- MongoGridFS
- gridfs
- &null;
-
-
- &Methods;
-
-
-
-
-
-
-
-
- &reference.mongo.entities.mongogridfsfile;
-
-
-
-
diff --git a/reference/mongo/mongogridfsfile/construct.xml b/reference/mongo/mongogridfsfile/construct.xml
deleted file mode 100644
index 2aa25ef7ff..0000000000
--- a/reference/mongo/mongogridfsfile/construct.xml
+++ /dev/null
@@ -1,71 +0,0 @@
-
-
-
-
-
- MongoGridfsFile::__construct
- Create a new GridFS file
-
-
- &reftitle.description;
-
- publicMongoGridfsFile::__construct
- MongoGridFSgridfs
- arrayfile
-
-
-
-
- &reftitle.parameters;
-
-
-
-
- gridfs
-
-
-
- The parent MongoGridFS instance.
-
-
-
-
-
- file
-
-
-
- A file from the database.
-
-
-
-
-
-
-
-
- &reftitle.returnvalues;
-
- Returns a new MongoGridFSFile.
-
-
-
-
diff --git a/reference/mongo/mongogridfsfile/getbytes.xml b/reference/mongo/mongogridfsfile/getbytes.xml
deleted file mode 100644
index c7d60e7c1c..0000000000
--- a/reference/mongo/mongogridfsfile/getbytes.xml
+++ /dev/null
@@ -1,73 +0,0 @@
-
-
-
-
-
- MongoGridFSFile::getBytes
- Returns this file's contents as a string of bytes
-
-
-
- &reftitle.description;
-
- publicstringMongoGridFSFile::getBytes
-
-
-
- Warning: this will load the file into memory. If the file is bigger than
- your memory, this will cause problems!
-
-
-
-
- &reftitle.parameters;
- &no.function.parameters;
-
-
-
- &reftitle.returnvalues;
-
- Returns a string of the bytes in the file.
-
-
-
-
- &reftitle.examples;
-
- MongoGridFSFile::getBytes example
-
-my_db->getGridFS('images');
-
-$image = $images->findOne('jwage.png');
-
-header('Content-type: image/png;');
-echo $image->getBytes();
-?>
-]]>
-
-
-
-
-
-
diff --git a/reference/mongo/mongogridfsfile/getfilename.xml b/reference/mongo/mongogridfsfile/getfilename.xml
deleted file mode 100644
index aabb9a7e6a..0000000000
--- a/reference/mongo/mongogridfsfile/getfilename.xml
+++ /dev/null
@@ -1,45 +0,0 @@
-
-
-
-
-
- MongoGridFSFile::getFilename
- Returns this file's filename
-
-
- &reftitle.description;
-
- publicstringMongoGridFSFile::getFilename
-
-
-
-
- &reftitle.parameters;
- &no.function.parameters;
-
-
- &reftitle.returnvalues;
-
- Returns the filename.
-
-
-
-
diff --git a/reference/mongo/mongogridfsfile/getresource.xml b/reference/mongo/mongogridfsfile/getresource.xml
deleted file mode 100644
index 03fc84d992..0000000000
--- a/reference/mongo/mongogridfsfile/getresource.xml
+++ /dev/null
@@ -1,82 +0,0 @@
-
-
-
-
-
- MongoGridFSFile::getResource
- Returns a resource that can be used to read the stored file
-
-
-
- &reftitle.description;
-
- publicresourceMongoGridFSFile::getResource
-
-
-
- This method returns a stream resource that can be used with all file
- functions in PHP that deal with reading files. The contents of the file are
- pulled out of MongoDB on the fly, so that the whole file does not have to
- be loaded into memory first.
-
-
- At most two GridFSFile chunks will be loaded in memory.
-
-
-
-
- &reftitle.parameters;
- &no.function.parameters;
-
-
-
- &reftitle.returnvalues;
-
- Returns a resource that can be used to read the file with
-
-
-
-
- &reftitle.examples;
-
- MongoGridFSFile::getResource example
-
-my_db->getGridFS('images');
-
-$image = $images->findOne('mongo.png');
-
-header('Content-type: image/png;');
-$stream = $image->getResource();
-
-while (!feof($stream)) {
- echo fread($stream, 8192);
-}
-?>
-]]>
-
-
-
-
-
-
diff --git a/reference/mongo/mongogridfsfile/getsize.xml b/reference/mongo/mongogridfsfile/getsize.xml
deleted file mode 100644
index eeeb93c87a..0000000000
--- a/reference/mongo/mongogridfsfile/getsize.xml
+++ /dev/null
@@ -1,45 +0,0 @@
-
-
-
-
-
- MongoGridFSFile::getSize
- Returns this file's size
-
-
- &reftitle.description;
-
- publicintMongoGridFSFile::getSize
-
-
-
-
- &reftitle.parameters;
- &no.function.parameters;
-
-
- &reftitle.returnvalues;
-
- Returns this file's size
-
-
-
-
diff --git a/reference/mongo/mongogridfsfile/write.xml b/reference/mongo/mongogridfsfile/write.xml
deleted file mode 100644
index 59a78fff90..0000000000
--- a/reference/mongo/mongogridfsfile/write.xml
+++ /dev/null
@@ -1,77 +0,0 @@
-
-
-
-
-
- MongoGridFSFile::write
- Writes this file to the filesystem
-
-
- &reftitle.description;
-
- publicintMongoGridFSFile::write
- stringfilename&null;
-
-
-
- &reftitle.parameters;
-
-
-
-
- filename
-
-
-
- The location to which to write the file. If none is given,
- the stored filename will be used.
-
-
-
-
-
-
-
- &reftitle.returnvalues;
-
- Returns the number of bytes written.
-
-
-
-
- &reftitle.examples;
-
- MongoGridFSFile::write example
-
-my_db->getGridFS('images');
-
-$image = $images->findOne('jwage.png');
-$image->write('/path/to/write/jwage.png');
-?>
-]]>
-
-
-
-
-
diff --git a/reference/mongo/mongoid.xml b/reference/mongo/mongoid.xml
deleted file mode 100644
index 543edee787..0000000000
--- a/reference/mongo/mongoid.xml
+++ /dev/null
@@ -1,138 +0,0 @@
-
-
-
-
-
- The MongoId class
- MongoId
-
-
-
-
- &mongo.alternative.class.note;
-
- MongoDB\BSON\ObjectId
-
-
-
-
-
- &reftitle.intro;
-
- A unique identifier created for database objects. If an object is inserted
- into the database without an _id field, an _id field will be added to it
- with a MongoId instance as its value. If the data
- has a naturally occurring unique field (e.g. username or timestamp) it is
- fine to use this as the _id field instead, and it will not be replaced with
- a MongoId.
-
-
- Instances of the MongoId class fulfill the role that
- autoincrementing does in a relational database: to provide a unique key if
- the data does not naturally have one. Autoincrementing does not work well
- with a sharded database, as it is difficult to determine the next number in
- the sequence. This class fulfills the constraints of quickly generating a
- value that is unique across shards.
-
-
- Each MongoId is 12 bytes (making its string form 24 hexadecimal characters).
- The first four bytes are a timestamp, the next three are a hash of the
- client machine's hostname, the next two are the two least significant bytes
- of the process id running the script, and the last three bytes are an
- incrementing value.
-
-
- MongoIds are serializable/unserializable. Their
- serialized form is similar to their string form:
-
-
-
-
-
-
-
-
- &reftitle.classsynopsis;
-
-
-
- MongoId
-
-
-
-
- MongoId
-
-
-
-
-
- public
- string
- $id
- &null;
-
-
- &Methods;
-
-
-
-
-
-
-
- Fields
-
-
- $id
-
-
- This field contains the string representation of this object.
-
-
-
- The property name begins with a $ character. It may
- be accessed using
- complex variable
- parsed syntax (e.g. $mongoId->{'$id'}).
-
-
-
-
-
-
-
-
- &reftitle.seealso;
-
- MongoDB core docs on ObjectIds.
-
-
-
-
- &reference.mongo.entities.mongoid;
-
-
-
-
diff --git a/reference/mongo/mongoid/construct.xml b/reference/mongo/mongoid/construct.xml
deleted file mode 100644
index 20119df51b..0000000000
--- a/reference/mongo/mongoid/construct.xml
+++ /dev/null
@@ -1,160 +0,0 @@
-
-
-
-
-
- MongoId::__construct
- Creates a new id
-
-
-
-
- &mongo.alternative.method.note;
-
- MongoDB\BSON\ObjectId::__construct
-
-
-
-
-
- &reftitle.description;
-
- publicMongoId::__construct
- stringMongoIdid&null;
-
-
-
-
- &reftitle.parameters;
-
-
-
-
- id
-
-
-
- A string (must be 24 hexadecimal characters) or a
- MongoId instance.
-
-
-
-
-
-
-
-
- &reftitle.returnvalues;
-
- Returns a new id.
-
-
-
-
- &reftitle.changelog;
-
-
-
-
- &Version;
- &Description;
-
-
-
-
- PECL mongo 1.4.0
-
- An exception is thrown when passed invalid string
-
-
-
-
-
-
-
-
- &reftitle.examples;
-
- MongoId::__construct example
-
- This example shows how to create a new id. This is seldom necessary, as the
- driver adds an id to arrays automatically before storing them in the
- database.
-
-
-
-]]>
-
- &example.outputs.similar;
-
-
-
-
-
- Parameter example
- This example shows how to use a string parameter to initialize a MongoId with a given value.
-
-
-]]>
-
- &example.outputs.similar;
-
-
-
-
-
-
-
- &reftitle.seealso;
-
-
- MongoId::__toString
- MongoId::isvalid
-
-
-
-
-
-
diff --git a/reference/mongo/mongoid/gethostname.xml b/reference/mongo/mongoid/gethostname.xml
deleted file mode 100644
index 9ed00fac61..0000000000
--- a/reference/mongo/mongoid/gethostname.xml
+++ /dev/null
@@ -1,75 +0,0 @@
-
-
-
-
-
- MongoId::getHostname
- Gets the hostname being used for this machine's ids
-
-
-
-
- &mongo.noalternative.method.note;
-
-
-
-
- &reftitle.description;
-
- publicstaticstringMongoId::getHostname
-
-
-
- This returns the hostname MongoId is using to
- generate unique ids. This should be the same value
- gethostname returns.
-
-
- It is identical to the function:
-
-
-
-]]>
-
-
-
-
- &reftitle.parameters;
- &no.function.parameters;
-
-
-
- &reftitle.returnvalues;
-
- Returns the hostname.
-
-
-
-
-
diff --git a/reference/mongo/mongoid/getinc.xml b/reference/mongo/mongoid/getinc.xml
deleted file mode 100644
index e3d2a2472e..0000000000
--- a/reference/mongo/mongoid/getinc.xml
+++ /dev/null
@@ -1,56 +0,0 @@
-
-
-
-
-
- MongoId::getInc
- Gets the incremented value to create this id
-
-
-
-
- &mongo.noalternative.method.note;
-
-
-
-
- &reftitle.description;
-
- publicintMongoId::getInc
-
-
-
-
-
- &reftitle.parameters;
- &no.function.parameters;
-
-
-
- &reftitle.returnvalues;
-
- Returns the incremented value used to create this MongoId.
-
-
-
-
-
diff --git a/reference/mongo/mongoid/getpid.xml b/reference/mongo/mongoid/getpid.xml
deleted file mode 100644
index 295ccd1010..0000000000
--- a/reference/mongo/mongoid/getpid.xml
+++ /dev/null
@@ -1,59 +0,0 @@
-
-
-
-
-
- MongoId::getPID
- Gets the process ID
-
-
-
-
- &mongo.noalternative.method.note;
-
-
-
-
- &reftitle.description;
-
- publicintMongoId::getPID
-
-
-
- Extracts the pid from the Mongo ID
-
-
-
-
- &reftitle.parameters;
- &no.function.parameters;
-
-
-
- &reftitle.returnvalues;
-
- Returns the PID of the MongoId.
-
-
-
-
-
diff --git a/reference/mongo/mongoid/gettimestamp.xml b/reference/mongo/mongoid/gettimestamp.xml
deleted file mode 100644
index 1c2f55345b..0000000000
--- a/reference/mongo/mongoid/gettimestamp.xml
+++ /dev/null
@@ -1,61 +0,0 @@
-
-
-
-
-
- MongoId::getTimestamp
- Gets the number of seconds since the epoch that this id was created
-
-
-
-
- &mongo.noalternative.method.note;
-
-
-
-
- &reftitle.description;
-
- publicintMongoId::getTimestamp
-
-
-
- This returns the same thing as running time when the id is created.
-
-
-
-
- &reftitle.parameters;
- &no.function.parameters;
-
-
-
- &reftitle.returnvalues;
-
- Returns the number of seconds since the epoch that this id was created. There are only
- four bytes of timestamp stored, so MongoDate is a better choice
- for storing exact or wide-ranging times.
-
-
-
-
-
diff --git a/reference/mongo/mongoid/isvalid.xml b/reference/mongo/mongoid/isvalid.xml
deleted file mode 100644
index 800831b627..0000000000
--- a/reference/mongo/mongoid/isvalid.xml
+++ /dev/null
@@ -1,75 +0,0 @@
-
-
-
-
-
- MongoId::isValid
- Check if a value is a valid ObjectId
-
-
-
-
- &mongo.noalternative.method.note;
-
-
-
-
- &reftitle.description;
-
- publicstaticboolMongoId::isValid
- mixedvalue
-
-
- This method may be used to check a variable before passing it as an argument
- to MongoId::__construct.
-
-
-
-
- &reftitle.parameters;
-
-
-
-
- value
-
-
-
- The value to check for validity.
-
-
-
-
-
-
-
-
- &reftitle.returnvalues;
-
- Returns &true; if value is a
- MongoId instance or a string consisting of exactly 24
- hexadecimal characters; otherwise, &false; is returned.
-
-
-
-
-
diff --git a/reference/mongo/mongoid/set-state.xml b/reference/mongo/mongoid/set-state.xml
deleted file mode 100644
index 9aa7adc673..0000000000
--- a/reference/mongo/mongoid/set-state.xml
+++ /dev/null
@@ -1,88 +0,0 @@
-
-
-
-
-
- MongoId::__set_state
- Create a dummy MongoId
-
-
-
-
- &mongo.noalternative.method.note;
-
-
-
-
- &reftitle.description;
-
- publicstaticMongoIdMongoId::__set_state
- arrayprops
-
-
- This function is only used by PHP internally, it shouldn't need to ever be
- called by the user.
-
-
- It is identical to the function:
-
-
-
-]]>
-
-
-
-
- &reftitle.parameters;
-
-
-
-
- props
-
-
-
- Theoretically, an array of properties used to create the new id.
- However, as MongoId instances have no properties, this is not used.
-
-
-
-
-
-
-
-
- &reftitle.returnvalues;
-
- A new id with the value "000000000000000000000000".
-
-
-
-
-
diff --git a/reference/mongo/mongoid/tostring.xml b/reference/mongo/mongoid/tostring.xml
deleted file mode 100644
index 8586167c43..0000000000
--- a/reference/mongo/mongoid/tostring.xml
+++ /dev/null
@@ -1,93 +0,0 @@
-
-
-
-
-
- MongoId::__toString
- Returns a hexidecimal representation of this id
-
-
-
-
- &mongo.alternative.method.note;
-
- MongoDB\BSON\ObjectId::__toString
-
-
-
-
-
- &reftitle.description;
-
- publicstringMongoId::__toString
-
-
-
-
-
- &reftitle.parameters;
- &no.function.parameters;
-
-
-
- &reftitle.returnvalues;
-
- This id.
-
-
-
-
- &reftitle.examples;
-
- MongoId::__toString example
-
-selectDB("foo")->selectCollection("bar");
-
-$collection->insert(array( "x" => "y" ));
-$collection->insert(array( "x" => "y" ));
-
-$cursor = $collection->find();
-$r1 = $cursor->next();
-$r2 = $cursor->next();
-
-echo $r1["_id"] . "\n";
-echo $r2["_id"] . "\n";
-
-?>
-]]>
-
- &example.outputs.similar;
-
-
-
-
-
-
-
-
diff --git a/reference/mongo/mongoinsertbatch.xml b/reference/mongo/mongoinsertbatch.xml
deleted file mode 100644
index 80f43e4bfa..0000000000
--- a/reference/mongo/mongoinsertbatch.xml
+++ /dev/null
@@ -1,76 +0,0 @@
-
-
-
-
-
- The MongoInsertBatch class
- MongoInsertBatch
-
-
-
-
-
- &reftitle.intro;
-
- Constructs a batch of INSERT operations. See MongoWriteBatch.
-
-
-
-
-
- &reftitle.classsynopsis;
-
-
-
- MongoInsertBatch
-
-
-
-
- MongoInsertBatch
-
-
-
- extends
- MongoWriteBatch
-
-
-
-
- &Methods;
-
-
- &InheritedMethods;
-
-
-
-
-
-
-
-
-
- &reference.mongo.entities.mongoinsertbatch;
-
-
-
-
diff --git a/reference/mongo/mongoinsertbatch/construct.xml b/reference/mongo/mongoinsertbatch/construct.xml
deleted file mode 100644
index 589879c7e7..0000000000
--- a/reference/mongo/mongoinsertbatch/construct.xml
+++ /dev/null
@@ -1,66 +0,0 @@
-
-
-
-
-
- MongoInsertBatch::__construct
- Description
-
-
-
- &reftitle.description;
-
- publicMongoInsertBatch::__construct
- MongoCollectioncollection
- arraywrite_options
-
-
- Constructs a batch of INSERT operations. See MongoWriteBatch.
-
-
-
-
-
- &reftitle.parameters;
-
-
- collection
- &mongo.mongowritebatch.collection.description;
-
-
- write_options
- &mongo.mongowritebatch.writeoptions.description;
-
-
-
-
-
- &reftitle.returnvalues;
-
- A new MongoInsertBatch.
-
-
-
-
-
-
-
diff --git a/reference/mongo/mongoint32.xml b/reference/mongo/mongoint32.xml
deleted file mode 100644
index 59c48ee2e0..0000000000
--- a/reference/mongo/mongoint32.xml
+++ /dev/null
@@ -1,97 +0,0 @@
-
-
-
-
-
- The MongoInt32 class
- MongoInt32
-
-
-
- &mongo.noalternative.class.note;
-
- Instead, the new extension chooses the appropriate database type depending
- on the integer's value.
-
-
-
-
-
- &reftitle.intro;
-
- The class can be used to save 32-bit integers to the database on a 64-bit
- system.
-
-
-
-
-
- &reftitle.classsynopsis;
-
-
-
- MongoInt32
-
-
-
-
- MongoInt32
-
-
-
-
- Fields
-
- public
- string
- value
-
-
- &Methods;
-
-
-
-
-
-
-
- Fields
-
-
- value
-
-
- This is the string value of the 32-bit number. For instance, 123's value
- would be "123".
-
-
-
-
-
-
-
-
- &reference.mongo.entities.mongoint32;
-
-
-
-
diff --git a/reference/mongo/mongoint32/construct.xml b/reference/mongo/mongoint32/construct.xml
deleted file mode 100644
index 51ae05859d..0000000000
--- a/reference/mongo/mongoint32/construct.xml
+++ /dev/null
@@ -1,77 +0,0 @@
-
-
-
-
-
- MongoInt32::__construct
- Creates a new 32-bit integer
-
-
-
-
- &mongo.noalternative.class.note;
-
- Instead, the new extension chooses the appropriate database type depending
- on the integer's value.
-
-
-
-
-
- &reftitle.description;
-
- publicMongoInt32::__construct
- stringvalue
-
-
- Creates a new 32-bit number with the given value.
-
-
-
-
- &reftitle.parameters;
-
-
-
-
- value
-
-
-
- A number.
-
-
-
-
-
-
-
-
- &reftitle.returnvalues;
-
- Returns a new integer.
-
-
-
-
-
-
diff --git a/reference/mongo/mongoint32/tostring.xml b/reference/mongo/mongoint32/tostring.xml
deleted file mode 100644
index 80526e7803..0000000000
--- a/reference/mongo/mongoint32/tostring.xml
+++ /dev/null
@@ -1,61 +0,0 @@
-
-
-
-
-
- MongoInt32::__toString
- Returns the string representation of this 32-bit integer
-
-
-
-
- &mongo.noalternative.class.note;
-
- Instead, the new extension chooses the appropriate database type depending
- on the integer's value.
-
-
-
-
-
- &reftitle.description;
-
- publicstringMongoInt32::__toString
-
-
-
-
-
- &reftitle.parameters;
- &no.function.parameters;
-
-
-
- &reftitle.returnvalues;
-
- Returns the string representation of this integer.
-
-
-
-
-
-
diff --git a/reference/mongo/mongoint64.xml b/reference/mongo/mongoint64.xml
deleted file mode 100644
index 33a1cb38fa..0000000000
--- a/reference/mongo/mongoint64.xml
+++ /dev/null
@@ -1,97 +0,0 @@
-
-
-
-
-
- The MongoInt64 class
- MongoInt64
-
-
-
- &mongo.noalternative.class.note;
-
- Instead, the new extension chooses the appropriate database type depending
- on the integer's value.
-
-
-
-
-
- &reftitle.intro;
-
- The class can be used to save 64-bit integers to the database on a 32-bit
- system.
-
-
-
-
-
- &reftitle.classsynopsis;
-
-
-
- MongoInt64
-
-
-
-
- MongoInt64
-
-
-
-
- Fields
-
- public
- string
- value
-
-
- &Methods;
-
-
-
-
-
-
-
- Fields
-
-
- value
-
-
- This is the string value of the 64-bit number. For instance, 123's value
- would be "123".
-
-
-
-
-
-
-
-
- &reference.mongo.entities.mongoint64;
-
-
-
-
diff --git a/reference/mongo/mongoint64/construct.xml b/reference/mongo/mongoint64/construct.xml
deleted file mode 100644
index ab6b217be2..0000000000
--- a/reference/mongo/mongoint64/construct.xml
+++ /dev/null
@@ -1,77 +0,0 @@
-
-
-
-
-
- MongoInt64::__construct
- Creates a new 64-bit integer
-
-
-
-
- &mongo.noalternative.class.note;
-
- Instead, the new extension chooses the appropriate database type depending
- on the integer's value.
-
-
-
-
-
- &reftitle.description;
-
- publicMongoInt64::__construct
- stringvalue
-
-
- Creates a new 64-bit number with the given value.
-
-
-
-
- &reftitle.parameters;
-
-
-
-
- value
-
-
-
- A number.
-
-
-
-
-
-
-
-
- &reftitle.returnvalues;
-
- Returns a new integer.
-
-
-
-
-
-
diff --git a/reference/mongo/mongoint64/tostring.xml b/reference/mongo/mongoint64/tostring.xml
deleted file mode 100644
index 6d9f46a34e..0000000000
--- a/reference/mongo/mongoint64/tostring.xml
+++ /dev/null
@@ -1,61 +0,0 @@
-
-
-
-
-
- MongoInt64::__toString
- Returns the string representation of this 64-bit integer
-
-
-
-
- &mongo.noalternative.class.note;
-
- Instead, the new extension chooses the appropriate database type depending
- on the integer's value.
-
-
-
-
-
- &reftitle.description;
-
- publicstringMongoInt64::__toString
-
-
-
-
-
- &reftitle.parameters;
- &no.function.parameters;
-
-
-
- &reftitle.returnvalues;
-
- Returns the string representation of this integer.
-
-
-
-
-
-
diff --git a/reference/mongo/mongolog.xml b/reference/mongo/mongolog.xml
deleted file mode 100644
index f3fca9c7fb..0000000000
--- a/reference/mongo/mongolog.xml
+++ /dev/null
@@ -1,347 +0,0 @@
-
-
-
-
-
- The MongoLog class
- MongoLog
-
-
-
-
-
- &reftitle.intro;
-
- Logging can be used to get detailed information about what the driver is
- doing. Logging is disabled by default, but this class allows you to activate
- specific levels of logging for various parts of the driver. Some examples:
-
-
-
-]]>
-
-
-
- By default, MongoLog emits all log messages as PHP notices. Depending
- on the SAPI you use, messages may be sent to
- stderr (for CLI) or the web server's
- error log. If, after configuring MongoLog, log messages are not appearing
- as expected, ensure that the E_NOTICE bit is included
- in error_reporting and that
- display_errors is on.
-
-
-
-
-
-
- &reftitle.classsynopsis;
-
-
-
- MongoLog
-
-
-
-
- MongoLog
-
-
-
-
- &Constants;
-
- const
- int
- MongoLog::NONE
- 0
-
-
- const
- int
- MongoLog::ALL
- 31
-
-
- level constants
-
- const
- int
- MongoLog::WARNING
- 1
-
-
- const
- int
- MongoLog::INFO
- 2
-
-
- const
- int
- MongoLog::FINE
- 4
-
-
- module constants
-
- const
- int
- MongoLog::RS
- 1
-
-
- const
- int
- MongoLog::POOL
- 1
-
-
- const
- int
- MongoLog::CON
- 2
-
-
- const
- int
- MongoLog::IO
- 4
-
-
- const
- int
- MongoLog::SERVER
- 8
-
-
- const
- int
- MongoLog::PARSE
- 16
-
-
- Fields
-
- private
- static
- int
- callback
-
-
- private
- static
- int
- level
-
-
- private
- static
- int
- module
-
-
- &Methods;
-
-
-
-
-
-
-
- &reftitle.constants;
-
- MongoLog Constants
-
- These constants can be used by both
- MongoLog::setLevel and
- MongoLog::setModule.
-
-
-
-
- MongoLog::NONE
-
-
- Log nothing.
-
-
-
-
- MongoLog::ALL
-
-
- Log everything.
-
-
-
-
-
-
-
- MongoLog Level Constants
-
- These constants can be used by MongoLog::setLevel.
-
-
-
- MongoLog::WARNING
-
-
- Log events that are somewhat exceptional, but not quite worthy of an
- actual exception (e.g. recoverable connection errors).
-
-
-
-
- MongoLog::INFO
-
-
- Log events that may be of interest to administrators, but are not
- particularly noteworthy (e.g. option parsing, authentication steps).
-
-
-
-
- MongoLog::FINE
-
-
- Log most events that the driver performs (e.g. server selection, socket
- communication). Depending on the module being logged, this can be
- extremely noisy and is primarily useful for debugging.
-
-
-
-
-
-
-
- MongoLog Module Constants
-
- These constants can be used by MongoLog::setModule.
-
-
-
- MongoLog::CON
-
-
- Log connection activity. Creating new connections, authentication,
- pinging, timeouts, etc.
-
-
-
-
- MongoLog::IO
-
-
- Log traffic to/from the database. Unless your program is trivial, this
- will create an enormous number of log messages.
-
-
-
-
- MongoLog::PARSE
-
-
- Log parsing of the connection string and options when constructing
- MongoClient.
-
-
-
-
- MongoLog::POOL
-
-
- Previously used to log connection pool activity. This option is now a
- deprecated alias of MongoLog::RS.
-
-
-
-
- MongoLog::RS
-
-
- Log replica set activity. Failovers, read preference selection, etc.
-
-
-
-
- MongoLog::SERVER
-
-
- Previously used to log server status changes. This option is deprecated
- in favor of MongoLog::RS.
-
-
-
-
-
-
-
-
- &reftitle.changelog;
-
-
-
-
-
- &Version;
- &Description;
-
-
-
-
- PECL mongo 1.3.0
-
- Added MongoLog::CON and deprecated
- MongoLog::POOL and
- MongoLog::SERVER.
-
-
-
-
-
-
-
-
-
-
- &reference.mongo.entities.mongolog;
-
-
-
-
diff --git a/reference/mongo/mongolog/getcallback.xml b/reference/mongo/mongolog/getcallback.xml
deleted file mode 100644
index 2f937691b0..0000000000
--- a/reference/mongo/mongolog/getcallback.xml
+++ /dev/null
@@ -1,63 +0,0 @@
-
-
-
-
-
- MongoLog::getCallback
- Gets the previously set callback function
-
-
-
- &reftitle.description;
-
- publicstaticcallableMongoLog::getCallback
-
-
-
- Retrieves the callback function.
-
-
-
-
- &reftitle.parameters;
- &no.function.parameters;
-
-
-
- &reftitle.returnvalues;
-
- Returns the callback function, or &false; if not set yet.
-
-
-
-
- &reftitle.notes;
-
-
- This function is only available with PHP 5.3.0 and later.
-
-
-
-
-
-
-
diff --git a/reference/mongo/mongolog/getlevel.xml b/reference/mongo/mongolog/getlevel.xml
deleted file mode 100644
index 58ff883188..0000000000
--- a/reference/mongo/mongolog/getlevel.xml
+++ /dev/null
@@ -1,76 +0,0 @@
-
-
-
-
-
- MongoLog::getLevel
- Gets the level(s) currently being logged
-
-
-
- &reftitle.description;
-
- publicstaticintMongoLog::getLevel
-
-
-
- This function can be used to see which log levels are currently enabled.
- The returned integer may be compared with the
- MongoLog level constants
- using bitwise operators to check for specific log levels.
-
-
-
-]]>
-
-
-
-
- &reftitle.parameters;
- &no.function.parameters;
-
-
-
- &reftitle.returnvalues;
-
- Returns the level(s) currently being logged.
-
-
-
-
-
-
diff --git a/reference/mongo/mongolog/getmodule.xml b/reference/mongo/mongolog/getmodule.xml
deleted file mode 100644
index 03038091ab..0000000000
--- a/reference/mongo/mongolog/getmodule.xml
+++ /dev/null
@@ -1,76 +0,0 @@
-
-
-
-
-
- MongoLog::getModule
- Gets the module(s) currently being logged
-
-
-
- &reftitle.description;
-
- publicstaticintMongoLog::getModule
-
-
-
- This function can be used to see which driver modules are currently being
- logged. The returned integer may be compared with the
- MongoLog module constants
- using bitwise operators to check if specific modules are being logged.
-
-
-
-]]>
-
-
-
-
- &reftitle.parameters;
- &no.function.parameters;
-
-
-
- &reftitle.returnvalues;
-
- Returns the module(s) currently being logged.
-
-
-
-
-
-
diff --git a/reference/mongo/mongolog/setcallback.xml b/reference/mongo/mongolog/setcallback.xml
deleted file mode 100644
index 62077cfbd6..0000000000
--- a/reference/mongo/mongolog/setcallback.xml
+++ /dev/null
@@ -1,202 +0,0 @@
-
-
-
-
-
- MongoLog::setCallback
- Sets a callback function to be invoked for events
-
-
-
- &reftitle.description;
-
- publicstaticvoidMongoLog::setCallback
- callablelog_function
-
-
- This function will set a callback function to be invoked for events in lieu
- of emitting of PHP notice.
-
-
-
-
- &reftitle.parameters;
-
-
-
- log_function
-
-
- The callback function to be invoked on events. It should have the following prototype:
-
-
-
- log_function
- intmodule
- intlevel
- stringmessage
-
-
-
- module
-
-
- One of the MongoLog
- module constants.
-
-
-
-
- level
-
-
- One of the MongoLog
- level constants.
-
-
-
-
- message
-
-
- The log message itself.
-
-
-
-
-
-
-
-
-
-
-
-
-
- &reftitle.returnvalues;
-
- &return.success;
-
-
-
-
- &reftitle.examples;
-
- MongoLog::setCallback example
-
-
-]]>
-
- &example.outputs.similar;
-
-
-
-
-
-
-
- &reftitle.notes;
-
-
- This function is only available with PHP 5.3.0 and later.
-
-
-
-
-
-
-
-
diff --git a/reference/mongo/mongolog/setlevel.xml b/reference/mongo/mongolog/setlevel.xml
deleted file mode 100644
index b39a305480..0000000000
--- a/reference/mongo/mongolog/setlevel.xml
+++ /dev/null
@@ -1,85 +0,0 @@
-
-
-
-
-
- MongoLog::setLevel
- Sets the level(s) to be logged
-
-
-
- &reftitle.description;
-
- publicstaticvoidMongoLog::setLevel
- intlevel
-
-
- This function can be used to control logging verbosity and the types of
- activities that should be logged. The
- MongoLog level constants
- may be used with bitwise operators to specify multiple levels.
-
-
-
-]]>
-
-
- Note that you must also call MongoLog::setModule to
- specify which modules(s) of the driver should log.
-
-
-
-
- &reftitle.parameters;
-
-
-
-
- level
-
-
-
- The level(s) you would like to log.
-
-
-
-
-
-
-
-
-
diff --git a/reference/mongo/mongolog/setmodule.xml b/reference/mongo/mongolog/setmodule.xml
deleted file mode 100644
index 7c687ac5fa..0000000000
--- a/reference/mongo/mongolog/setmodule.xml
+++ /dev/null
@@ -1,84 +0,0 @@
-
-
-
-
-
- MongoLog::setModule
- Sets the module(s) to be logged
-
-
-
- &reftitle.description;
-
- publicstaticvoidMongoLog::setModule
- intmodule
-
-
- This function can be used to set which driver modules should be logged. The
- MongoLog module constants
- may be used with bitwise operators to specify multiple modules.
-
-
-
-]]>
-
-
- Note that you must also call MongoLog::setLevel to
- enable logging.
-
-
-
-
- &reftitle.parameters;
-
-
-
-
- module
-
-
-
- The module(s) you would like to log.
-
-
-
-
-
-
-
-
-
diff --git a/reference/mongo/mongomaxkey.xml b/reference/mongo/mongomaxkey.xml
deleted file mode 100644
index 3ec42afbf1..0000000000
--- a/reference/mongo/mongomaxkey.xml
+++ /dev/null
@@ -1,112 +0,0 @@
-
-
-
-
-
- The MongoMaxKey class
- MongoMaxKey
-
-
-
-
- &mongo.alternative.class.note;
-
- MongoDB\BSON\MaxKey
-
-
-
-
-
- &reftitle.intro;
-
- MongoMaxKey is an special type used by the database
- that compares greater than all other possible BSON values. Thus, if a query
- is sorted by a given field in ascending order, any document with a
- MongoMaxKey as its value will be returned last.
-
-
- MongoMaxKey has no associated fields, methods, or
- constants. It is merely the "greatest" value that can be represented in the
- database.
-
-
-
- MongoMaxKey is used internally by MongoDB for
- indexing and sharding. There is generally no reason to use this class in
- an application.
-
-
-
-
-
-
- &reftitle.classsynopsis;
-
-
-
- MongoMaxKey
-
-
-
-
- MongoMaxKey
-
-
-
-
-
-
-
-
-
- Using MongoMaxKey as a value
-
-insert(array("task" => "dishes", "doBy" => new MongoMaxKey));
-$collection->insert(array("task" => "staff meeting", "doBy" => new MongoDate(strtotime("+4 days"))));
-
-$cursor = $collection->find()->sort(array("doBy" => 1));
-
-?>
-]]>
-
-
- The cursor will return the staff meeting document followed by the dishes
- document. The dishes document will always be returned last, regardless of
- what else is added to the collection (unless other documents are added with
- MongoMaxKey in their "doBy" field).
-
-
-
-
- &reftitle.seealso;
-
- MongoMinKey
-
-
-
-
-
-
-
diff --git a/reference/mongo/mongominkey.xml b/reference/mongo/mongominkey.xml
deleted file mode 100644
index eb5dfe4972..0000000000
--- a/reference/mongo/mongominkey.xml
+++ /dev/null
@@ -1,112 +0,0 @@
-
-
-
-
-
- The MongoMinKey class
- MongoMinKey
-
-
-
-
- &mongo.alternative.class.note;
-
- MongoDB\BSON\MinKey
-
-
-
-
-
- &reftitle.intro;
-
- MongoMinKey is an special type used by the database
- that compares less than all other possible BSON values. Thus, if a query is
- sorted by a given field in ascending order, any document with a
- MongoMinKey as its value will be returned first.
-
-
- MongoMinKey has no associated fields, methods, or
- constants. It is merely the "smallest" value that can be represented in the
- database.
-
-
-
- MongoMinKey is used internally by MongoDB for
- indexing and sharding. There is generally no reason to use this class in
- an application.
-
-
-
-
-
-
- &reftitle.classsynopsis;
-
-
-
- MongoMinKey
-
-
-
-
- MongoMinKey
-
-
-
-
-
-
-
-
-
- Using MongoMinKey as a value
-
-insert(array("task" => "lunch", "doBy" => new MongoMinKey));
-$collection->insert(array("task" => "staff meeting", "doBy" => new MongoDate(strtotime("+4 days"))));
-
-$cursor = $collection->find()->sort(array("doBy" => 1));
-
-?>
-]]>
-
-
- The cursor will return the lunch document followed by the staff meeting
- document. The lunch document will always be returned first, regardless of
- what else is added to the collection (unless other documents are added with
- MongoMinKey in their "doBy" field).
-
-
-
-
- &reftitle.seealso;
-
- MongoMaxKey
-
-
-
-
-
-
-
diff --git a/reference/mongo/mongopool.xml b/reference/mongo/mongopool.xml
deleted file mode 100644
index 2c786bfb30..0000000000
--- a/reference/mongo/mongopool.xml
+++ /dev/null
@@ -1,102 +0,0 @@
-
-
-
-
-
- The MongoPool class
- MongoPool
-
-
-
-
-
- &reftitle.intro;
-
-
- The current (1.3.0+) releases of the driver no longer implements pooling.
- This class and its methods are therefore deprecated and should not be
- used.
-
-
-
-
-
-
- &reftitle.classsynopsis;
-
-
-
- MongoPool
-
-
-
-
- MongoPool
-
-
-
-
- &Methods;
-
-
-
-
-
-
- &reftitle.changelog;
-
-
-
-
-
- &Version;
- &Description;
-
-
-
-
- PECL mongo 1.3.0
-
- This functionality has been removed and no longer does anything other
- than emit deprecation warnings. This class is only kept around for
- backwards compatibility and will be removed in the near future.
-
-
-
- PECL mongo 1.2.11
-
- Emits E_DEPRECATED when used.
-
-
-
-
-
-
-
-
-
-
- &reference.mongo.entities.mongopool;
-
-
-
-
diff --git a/reference/mongo/mongopool/getsize.xml b/reference/mongo/mongopool/getsize.xml
deleted file mode 100644
index e133ab7170..0000000000
--- a/reference/mongo/mongopool/getsize.xml
+++ /dev/null
@@ -1,118 +0,0 @@
-
-
-
-
-
- MongoPool::getSize
- Get pool size for connection pools
-
-
-
- &reftitle.description;
-
- publicstaticintMongoPool::getSize
-
-
-
-
-
- &reftitle.parameters;
- &no.function.parameters;
-
-
-
- &reftitle.returnvalues;
-
- Returns the current pool size.
-
-
-
- &reftitle.changelog;
-
-
-
-
-
- &Version;
- &Description;
-
-
-
-
- PECL mongo 1.2.11
- Emits E_DEPRECATED when used.
-
-
-
-
-
-
-
-
- &reftitle.examples;
-
- Changing pool size
-
- This returns the default pool size, sets a new pool size, then prints the
- new pool size and the pool debugging information. Note that changing the
- pool size only affects new connection pools, it does not change old ones.
-
-
-
-]]>
-
-
-
-
-
- &reftitle.seealso;
-
-
- MongoPool::setSize
- MongoPool::info
- The connection documentation.
-
-
-
-
-
-
diff --git a/reference/mongo/mongopool/info.xml b/reference/mongo/mongopool/info.xml
deleted file mode 100644
index 8146af4bef..0000000000
--- a/reference/mongo/mongopool/info.xml
+++ /dev/null
@@ -1,159 +0,0 @@
-
-
-
-
-
- MongoPool::info
- Returns information about all connection pools
-
-
-
- &reftitle.description;
-
- publicarrayMongoPool::info
-
-
-
-
- Returns an array of information about all connection pools.
-
-
-
-
- &reftitle.parameters;
- &no.function.parameters;
-
-
-
- &reftitle.returnvalues;
-
- Each connection pool has an identifier, which starts with the host. For each
- pool, this function shows the following fields:
-
-
-
- in use
-
-
-
- The number of connections currently being used by
- Mongo instances.
-
-
-
-
-
- in pool
-
-
-
- The number of connections currently in the pool (not being used).
-
-
-
-
-
- remaining
-
-
-
- The number of connections that could be created by this pool. For
- example, suppose a pool had 5 connections remaining and 3 connections in
- the pool. We could create 8 new instances of
- MongoClient before we exhausted this pool
- (assuming no instances of MongoClient went out of
- scope, returning their connections to the pool).
-
-
- A negative number means that this pool will spawn unlimited connections.
-
-
- Before a pool is created, you can change the max number of connections by
- calling Mongo::setPoolSize. Once a pool is showing
- up in the output of this function, its size cannot be changed.
-
-
-
-
-
- total
-
-
-
- The total number of connections allowed for this pool. This should be
- greater than or equal to "in use" + "in pool" (or -1).
-
-
-
-
-
- timeout
-
-
-
- The socket timeout for connections in this pool. This is how long
- connections in this pool will attempt to connect to a server before
- giving up.
-
-
-
-
-
- waiting
-
-
-
- If you have capped the pool size, workers requesting connections from
- the pool may block until other workers return their connections. This
- field shows how many milliseconds workers have blocked for connections to
- be released. If this number keeps increasing, you may want to use
- MongoPool::setSize to add more connections to your
- pool.
-
-
-
-
-
-
-
- &reftitle.changelog;
-
-
-
-
-
- &Version;
- &Description;
-
-
-
-
- PECL mongo 1.2.11
- Emits E_DEPRECATED when used.
-
-
-
-
-
-
-
-
-
diff --git a/reference/mongo/mongopool/setsize.xml b/reference/mongo/mongopool/setsize.xml
deleted file mode 100644
index 334e551c5d..0000000000
--- a/reference/mongo/mongopool/setsize.xml
+++ /dev/null
@@ -1,144 +0,0 @@
-
-
-
-
-
- MongoPool::setSize
- Set the size for future connection pools
-
-
-
- &reftitle.description;
-
- publicstaticboolMongoPool::setSize
- intsize
-
-
-
- Sets the max number of connections new pools will be able to create.
-
-
-
-
- &reftitle.parameters;
-
-
-
-
- size
-
-
-
- The max number of connections future pools will be able to create.
- Negative numbers mean that the pool will spawn an infinite number of
- connections.
-
-
-
-
-
-
-
-
- &reftitle.returnvalues;
-
- Returns the former value of pool size.
-
-
-
-
- &reftitle.changelog;
-
-
-
-
-
- &Version;
- &Description;
-
-
-
-
- PECL mongo 1.2.11
- Emits E_DEPRECATED when used.
-
-
-
-
-
-
-
-
-
- &reftitle.examples;
-
-
- Mongo::setPoolSize example
-
- If you set the pool size to n and then create
- n connections, attempting to create an
- n+1st connection will throw a
- MongoConnectionException.
-
-
-
-]]>
-
- &example.outputs.similar;
-
-__construct()
-#1 {main}
- thrown in /path/to/php/script.php on line 10
-]]>
-
-
-
-
-
-
-
- &reftitle.seealso;
-
-
- MongoPool::getSize
- MongoPool::info
- The connection documentation.
-
-
-
-
-
diff --git a/reference/mongo/mongoprotocolexception.xml b/reference/mongo/mongoprotocolexception.xml
deleted file mode 100644
index b08e84c253..0000000000
--- a/reference/mongo/mongoprotocolexception.xml
+++ /dev/null
@@ -1,106 +0,0 @@
-
-
-
-
-
- The MongoProtocolException class
- MongoProtocolException
-
-
-
-
-
- &reftitle.intro;
-
- When talking to MongoDB 2.6.0, and later, certain operations (such as writes) may throw MongoProtocolException when the response
- from the server did not make sense - for example during network failure (we could read the entire response) or data corruption.
-
-
- This exception is also thrown when attempting to talk newer protocols then the server supports, for example using the
- MongoWriteBatch when talking to a MongoDB server prior to 2.6.0.
-
-
-
-
-
- &reftitle.classsynopsis;
-
-
-
- MongoProtocolException
-
-
-
-
- MongoProtocolException
-
-
-
- extends
- MongoException
-
-
-
- &InheritedProperties;
-
-
-
-
-
-
-
-
- &reftitle.examples;
-
- Catching MongoProtocolException
-
- Running the following example against MongoDB prior to 2.6.0 will throw an MongoProtocolException
-
-
-selectCollection("test", "test");
-
-try {
- $batch = new MongoInsertBatch($c);
-} catch(MongoProtocolException $e) {
- echo $e->getMessage();
-}
-?>
-]]>
-
- &examples.outputs.similar;
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/reference/mongo/mongoregex.xml b/reference/mongo/mongoregex.xml
deleted file mode 100644
index adf8dc7fa5..0000000000
--- a/reference/mongo/mongoregex.xml
+++ /dev/null
@@ -1,138 +0,0 @@
-
-
-
-
-
- The MongoRegex class
- MongoRegex
-
-
-
-
- &mongo.alternative.class.note;
-
- MongoDB\BSON\Regex
-
-
-
-
-
- &reftitle.intro;
-
- This class can be used to create regular expressions. Typically, these
- expressions will be used to query the database and find matching strings.
- More unusually, they can be saved to the database and retrieved.
-
-
- Regular expressions consist of four parts. First a /
- as starting delimiter, then the pattern, another /
- and finally a string containing flags.
-
-
-
- Regular expression pattern
-
-
-
-
-
-
- MongoDB recognizes six regular expression flags:
-
-
-
-
- i: Case insensitive
-
-
-
-
- m: Multiline
-
-
-
-
- x: Can contain comments
-
-
-
-
- l: locale
-
-
-
-
- s: dotall, "." matches everything, including newlines
-
-
-
-
- u: match unicode
-
-
-
-
-
-
-
- &reftitle.classsynopsis;
-
-
-
- MongoRegex
-
-
-
-
- MongoRegex
-
-
-
-
- Fields
-
- public
- string
- regex
-
-
- public
- string
- flags
-
-
- &Methods;
-
-
-
-
-
-
-
-
- &reference.mongo.entities.mongoregex;
-
-
-
-
diff --git a/reference/mongo/mongoregex/construct.xml b/reference/mongo/mongoregex/construct.xml
deleted file mode 100644
index 885bebb9ae..0000000000
--- a/reference/mongo/mongoregex/construct.xml
+++ /dev/null
@@ -1,105 +0,0 @@
-
-
-
-
-
- MongoRegex::__construct
- Creates a new regular expression
-
-
-
-
- &mongo.alternative.method.note;
-
- MongoDB\BSON\Regex::__construct
-
-
-
-
-
- &reftitle.description;
-
- publicMongoRegex::__construct
- stringregex
-
-
- Creates a new regular expression.
-
-
-
-
- &reftitle.parameters;
-
-
-
-
- regex
-
-
-
- Regular expression string of the form /expr/flags.
-
-
-
-
-
-
-
-
- &reftitle.returnvalues;
-
- Returns a new regular expression.
-
-
-
-
- &reftitle.examples;
-
-
- MongoRegex::__construct example
- This example uses a regular expression to query for all documents
- with a username field starting (^) with an
- l and a vowel ([aeiouy]),
- case-insensitive (/i).
-
-find(array("username" => $luke_search));
-?>
-]]>
-
-
-
-
-
-
- &reftitle.seealso;
-
-
- MongoRegex::__toString
-
-
-
-
-
-
diff --git a/reference/mongo/mongoregex/tostring.xml b/reference/mongo/mongoregex/tostring.xml
deleted file mode 100644
index 6d004631f1..0000000000
--- a/reference/mongo/mongoregex/tostring.xml
+++ /dev/null
@@ -1,91 +0,0 @@
-
-
-
-
-
- MongoRegex::__toString
- A string representation of this regular expression
-
-
-
-
- &mongo.alternative.method.note;
-
- MongoDB\BSON\Regex::__toString
-
-
-
-
-
- &reftitle.description;
-
- publicstringMongoRegex::__toString
-
-
-
- Returns a string representation of this regular expression.
-
-
-
-
- &reftitle.parameters;
- &no.function.parameters;
-
-
-
- &reftitle.returnvalues;
-
- This regular expression in the form "/expr/flags".
-
-
-
-
- &reftitle.examples;
-
-
- MongoRegex::__toString example
-
-regex . "\n";
-echo $r->flags . "\n";
-echo "$r\n";
-
-?>
-]]>
-
- &example.outputs.similar;
-
-
-
-
-
-
-
-
-
diff --git a/reference/mongo/mongoresultexception.xml b/reference/mongo/mongoresultexception.xml
deleted file mode 100644
index 21ba7acd87..0000000000
--- a/reference/mongo/mongoresultexception.xml
+++ /dev/null
@@ -1,100 +0,0 @@
-
-
-
-
-
- The MongoResultException class
- MongoResultException
-
-
-
-
-
- &reftitle.intro;
-
- The MongoResultException is thrown by several command helpers (such as
- MongoCollection::findAndModify) in the event of
- failure. The original result document is available through
- MongoResultException::getDocument.
-
-
-
-
-
- &reftitle.classsynopsis;
-
-
-
- MongoResultException
-
-
-
-
- MongoResultException
-
-
-
- extends
- MongoException
-
-
-
- &Properties;
-
- public
- document
-
-
- &InheritedProperties;
-
-
- &Methods;
-
-
-
-
-
-
-
-
-
-
- &reftitle.properties;
-
-
- document
-
- The raw result document as an array.
-
-
-
-
-
-
-
-
-
- &reference.mongo.entities.mongoresultexception;
-
-
-
-
diff --git a/reference/mongo/mongoresultexception/getdocument.xml b/reference/mongo/mongoresultexception/getdocument.xml
deleted file mode 100644
index 55f80710bf..0000000000
--- a/reference/mongo/mongoresultexception/getdocument.xml
+++ /dev/null
@@ -1,134 +0,0 @@
-
-
-
-
-
- MongoResultException::getDocument
- Retrieve the full result document
-
-
-
- &reftitle.description;
-
- publicarrayMongoResultException::getDocument
-
-
-
- Retrieves the full error result document.
-
-
-
-
-
- &reftitle.parameters;
- &no.function.parameters;
-
-
-
- &reftitle.returnvalues;
-
- The full result document as an array, including partial data if available and
- additional keys.
-
-
-
-
- &reftitle.examples;
-
- MongoResultException::getDocument example
-
-selectCollection("test", "test");
-
-$c->insert(array(
- "name" => "Next promo",
- "inprogress" => false,
- "priority" => 0,
- "tasks" => array( "select product", "add inventory", "do placement"),
-) );
-
-$c->insert(array(
- "name" => "Biz report",
- "inprogress" => false,
- "priority" => 1,
- "tasks" => array( "run sales report", "email report" )
-) );
-
-$c->insert(array(
- "name" => "Biz report",
- "inprogress" => false,
- "priority" => 2,
- "tasks" => array( "run marketing report", "email report" )
- ),
- array("w" => true)
-);
-
-try {
- $retval = $c->findAndModify(
- array("inprogress" => false, "name" => "Biz report"),
- array('$set' => array('$set' => array('inprogress' => true, "started" => new MongoDate()))),
- null,
- array(
- "sort" => array("priority" => -1),
- "new" => true,
- )
- );
-} catch(MongoResultException $e) {
- echo $e->getMessage(), "\n";
- $res = $e->getDocument();
- var_dump($res);
-}
-?>
-]]>
-
- &examples.outputs.similar;
-
-
- array(5) {
- ["connectionId"]=>
- int(6)
- ["err"]=>
- string(30) "$set is not valid for storage."
- ["code"]=>
- int(52)
- ["n"]=>
- int(0)
- ["ok"]=>
- float(1)
- }
- ["ok"]=>
- float(0)
- ["errmsg"]=>
- string(30) "$set is not valid for storage."
-}
-]]>
-
-
-
-
-
-
diff --git a/reference/mongo/mongotimestamp.xml b/reference/mongo/mongotimestamp.xml
deleted file mode 100644
index 72e92b1aea..0000000000
--- a/reference/mongo/mongotimestamp.xml
+++ /dev/null
@@ -1,99 +0,0 @@
-
-
-
-
-
- The MongoTimestamp class
- MongoTimestamp
-
-
-
-
- &mongo.alternative.class.note;
-
- MongoDB\BSON\Timestamp
-
-
-
-
-
- &reftitle.intro;
-
- MongoTimestamp is an internal type used by MongoDB
- for replication and sharding. It consists of a 4-byte timestamp (i.e.
- seconds since the epoch) and a 4-byte increment. This type is not intended
- for storing time or date values (e.g. a "createdAt" field on a document).
-
-
-
- Unless you are writing an application that interacts with MongoDB's
- replication oplog or sharding internals: stop, go directly to
- MongoDate, do not pass go, and do not collect 200
- dollars. This is not the class you are looking for.
-
-
-
-
-
-
- &reftitle.classsynopsis;
-
-
-
- MongoTimestamp
-
-
-
-
- MongoTimestamp
-
-
-
-
- Fields
-
- public
- int
- sec
- 0
-
-
- public
- int
- inc
- 0
-
-
- &Methods;
-
-
-
-
-
-
-
-
- &reference.mongo.entities.mongotimestamp;
-
-
-
-
diff --git a/reference/mongo/mongotimestamp/construct.xml b/reference/mongo/mongotimestamp/construct.xml
deleted file mode 100644
index 36c9105c92..0000000000
--- a/reference/mongo/mongotimestamp/construct.xml
+++ /dev/null
@@ -1,99 +0,0 @@
-
-
-
-
-
- MongoTimestamp::__construct
- Creates a new timestamp
-
-
-
-
- &mongo.alternative.method.note;
-
- MongoDB\BSON\Timestamp::__construct
-
-
-
-
-
- &reftitle.description;
-
- publicMongoTimestamp::__construct
- intsectime()
- intinc
-
-
- Creates a new timestamp. If no parameters are given, the current time is
- used and the increment is automatically provided. The increment is set to 0
- when the module is loaded and is incremented every time this constructor is
- called (without the $inc parameter passed in).
-
-
-
-
- &reftitle.parameters;
-
-
-
-
- sec
-
-
-
- Number of seconds since the epoch (i.e. 1 Jan 1970 00:00:00.000 UTC).
-
-
-
-
-
- inc
-
-
-
- Increment.
-
-
-
-
-
-
-
-
- &reftitle.returnvalues;
-
- Returns this new timestamp.
-
-
-
-
- &reftitle.seealso;
-
-
- MongoTimestamp::__toString
-
-
-
-
-
-
-
diff --git a/reference/mongo/mongotimestamp/tostring.xml b/reference/mongo/mongotimestamp/tostring.xml
deleted file mode 100644
index b3e8db9e8c..0000000000
--- a/reference/mongo/mongotimestamp/tostring.xml
+++ /dev/null
@@ -1,62 +0,0 @@
-
-
-
-
-
- MongoTimestamp::__toString
- Returns a string representation of this timestamp
-
-
-
-
- &mongo.alternative.method.note;
-
- MongoDB\BSON\Timestamp::__toString
-
-
-
-
-
- &reftitle.description;
-
- publicstringMongoTimestamp::__toString
-
-
-
- Returns the "sec" field of this timestamp.
-
-
-
-
- &reftitle.parameters;
- &no.function.parameters;
-
-
-
- &reftitle.returnvalues;
-
- The seconds since epoch represented by this timestamp.
-
-
-
-
-
diff --git a/reference/mongo/mongoupdatebatch.xml b/reference/mongo/mongoupdatebatch.xml
deleted file mode 100644
index a550b8dc29..0000000000
--- a/reference/mongo/mongoupdatebatch.xml
+++ /dev/null
@@ -1,76 +0,0 @@
-
-
-
-
-
- The MongoUpdateBatch class
- MongoUpdateBatch
-
-
-
-
-
- &reftitle.intro;
-
- Constructs a batch of UPDATE operations. See MongoWriteBatch.
-
-
-
-
-
- &reftitle.classsynopsis;
-
-
-
- MongoUpdateBatch
-
-
-
-
- MongoUpdateBatch
-
-
-
- extends
- MongoWriteBatch
-
-
-
-
- &Methods;
-
-
- &InheritedMethods;
-
-
-
-
-
-
-
-
-
- &reference.mongo.entities.mongoupdatebatch;
-
-
-
-
diff --git a/reference/mongo/mongoupdatebatch/construct.xml b/reference/mongo/mongoupdatebatch/construct.xml
deleted file mode 100644
index dbf8ad930c..0000000000
--- a/reference/mongo/mongoupdatebatch/construct.xml
+++ /dev/null
@@ -1,66 +0,0 @@
-
-
-
-
-
- MongoUpdateBatch::__construct
- Description
-
-
-
- &reftitle.description;
-
- publicMongoUpdateBatch::__construct
- MongoCollectioncollection
- arraywrite_options
-
-
- Constructs a batch of UPDATE operations. See MongoWriteBatch.
-
-
-
-
-
- &reftitle.parameters;
-
-
- collection
- &mongo.mongowritebatch.collection.description;
-
-
- write_options
- &mongo.mongowritebatch.writeoptions.description;
-
-
-
-
-
- &reftitle.returnvalues;
-
- A new MongoUpdateBatch.
-
-
-
-
-
-
-
diff --git a/reference/mongo/mongowritebatch.xml b/reference/mongo/mongowritebatch.xml
deleted file mode 100644
index 01b2b502ef..0000000000
--- a/reference/mongo/mongowritebatch.xml
+++ /dev/null
@@ -1,200 +0,0 @@
-
-
-
-
-
- The MongoWriteBatch class
- MongoWriteBatch
-
-
-
-
-
- &reftitle.intro;
-
- MongoWriteBatch is the base class for the MongoInsertBatch,
- MongoUpdateBatch and MongoDeleteBatch classes.
-
-
- MongoWriteBatch allows you to "batch up" multiple operations (of same type) and shipping them all
- to MongoDB at the same time. This can be especially useful when operating on many documents at the
- same time to reduce roundtrips.
-
-
- Prior to version 1.5.0 of the driver it was possible to use MongoCollection::batchInsert,
- however, as of 1.5.0 that method is now discouraged.
-
-
- Note: This class is only available when talking to MongoDB 2.6.0 (and later) servers. It will throw
- MongoProtocolException if attempting to use it on older MongoDB servers.
-
-
-
-
-
- &reftitle.classsynopsis;
-
-
-
- MongoWriteBatch
-
-
-
-
- MongoWriteBatch
-
-
-
-
- &Constants;
-
- const
- int
- MongoWriteBatch::COMMAND_INSERT
- 1
-
-
- const
- int
- MongoWriteBatch::COMMAND_UPDATE
- 2
-
-
- const
- int
- MongoWriteBatch::COMMAND_DELETE
- 3
-
-
- &Methods;
-
-
-
-
-
-
- MongoWriteBatch types
-
-
-
- MongoWriteBatch::COMMAND_INSERT
-
- Create an Insert Write Batch
-
-
-
-
- MongoWriteBatch::COMMAND_UPDATE
-
- Create an Update Write Batch
-
-
-
-
- MongoWriteBatch::COMMAND_DELETE
-
- Create an Delete Write Batch
-
-
-
-
-
-
-
-
- &reftitle.description;
-
- When executing a batch by calling
- MongoWriteBatch::execute, MongoWriteBatch will send
- up to maxWriteBatchSize (defaults to 1000) documents or
- maxBsonObjectSize (defaults to 16777216 bytes), whichever
- comes first.
-
-
-
- Documents will never be partially transferred. When adding documents to the batch, that overflows the limit, a new
- batch will be created and the document put into the new batch.
-
-
-
-
-
- &reftitle.errors;
-
- Exception on parameter parsing failures
- Exception on argument validation errors (e.g. missing keys)
- MongoProtocolException when talking to MongoDB server older then 2.6.0.
- MongoProtocolException on socket errors.
- MongoWriteConcernException when a write fails due to WriteConcerns
-
-
-
-
- &reftitle.examples;
-
- MongoWriteBatch example
-
- Adding documents to a Insert batch and then execute it
-
-
-selectCollection("test", "test");
-
-
-$docs = array();
-$docs[] = array("my" => "demo");
-$docs[] = array("is" => "working");
-$docs[] = array("pretty" => "well");
-
-$batch = new MongoInsertBatch($collection);
-foreach($docs as $document) {
- $batch->add($document);
-}
-$retval = $batch->execute(array("w" => 1));
-var_dump($retval);
-?>
-]]>
-
- &example.outputs;
-
-
- int(3)
- ["ok"]=>
- bool(true)
-}
-]]>
-
-
-
-
-
-
- &reference.mongo.entities.mongowritebatch;
-
-
-
-
diff --git a/reference/mongo/mongowritebatch/add.xml b/reference/mongo/mongowritebatch/add.xml
deleted file mode 100644
index d725c988b7..0000000000
--- a/reference/mongo/mongowritebatch/add.xml
+++ /dev/null
@@ -1,213 +0,0 @@
-
-
-
-
-
- MongoWriteBatch::add
- Adds a write operation to a batch
-
-
-
- &reftitle.description;
-
- publicboolMongoWriteBatch::add
- arrayitem
-
-
- Adds a write operation to the batch.
-
-
- If $item causes the batch to exceed the
- maxWriteBatchSize or maxBsonObjectSize
- limits, the driver will internally split the batches into multiple write
- commands upon calling MongoWriteBatch::execute.
-
-
-
-
- &reftitle.parameters;
-
-
- item
-
-
- An array that describes a write operation. The structure of this value
- depends on the batch's operation type.
-
-
-
- Batch type
- Argument expectation
-
-
-
-
- MongoWriteBatch::COMMAND_INSERT
-
- The document to add.
-
-
-
- MongoWriteBatch::COMMAND_UPDATE
-
- Raw update operation.
- Required keys are "q" and "u", which correspond to the $criteria and $new_object parameters of MongoCollection::update, respectively.
- Optional keys are "multi" and "upsert", which correspond to the "multiple" and "upsert" options for MongoCollection::update, respectively. If unspecified, both options default to &false;.
-
-
-
- MongoWriteBatch::COMMAND_DELETE
-
- Raw delete operation.
- Required keys are: "q" and "limit", which correspond to the $criteria parameter and "justOne" option of MongoCollection::remove, respectively.
- The "limit" option is an int; however, MongoDB only supports 0 (i.e. remove all matching documents) and 1 (i.e. remove at most one matching document) at this time.
-
-
-
-
-
-
-
-
-
-
-
- &reftitle.returnvalues;
-
- Returns &true; on success and throws an exception on failure.
-
-
-
-
- &reftitle.errors;
-
- Exception on parameter parsing failures
- Exception on argument validation errors (e.g. missing keys)
-
-
-
-
- &reftitle.examples;
-
- MongoWriteBatch::add example
-
- Batching up multiple insert operations
-
-
-selectCollection("test", "test");
-
-
-$docs = array();
-$docs[] = array("my" => "demo");
-$docs[] = array("is" => "working");
-$docs[] = array("pretty" => "well");
-
-$batch = new MongoInsertBatch($collection);
-foreach($docs as $document) {
- $batch->add($document);
-}
-$batch->execute(array("w" => 1));
-?>
-]]>
-
-
-
-
- MongoWriteBatch::add example
-
- Batching up multiple update operations
-
-
-selectCollection("test", "test");
-
-
-$item1 = array(
- "q" => array("my" => "demo"),
- "u" => array('$set' => array("try" => 1)),
- "multi" => false, /* default value */
- "upsert" => false, /* default value */
-);
-$item2 = array(
- "q" => array("is" => "working"),
- "u" => array('$set' => array("try" => 2)),
- "multi" => true,
-);
-$item3 = array(
- "q" => array("created" => "new-document"),
- "u" => array('$set' => array("try" => 3)),
- "upsert" => true,
-);
-
-$batch = new MongoUpdateBatch($collection);
-$batch->add($item1);
-$batch->add($item2);
-$batch->add($item3);
-$batch->execute(array("w" => 1));
-
-?>
-]]>
-
-
-
-
- MongoWriteBatch::add example
-
- Batching up multiple delete operations
-
-
-selectCollection("test", "test");
-
-
-$item1 = array(
- "q" => array("my" => "demo"),
- "limit" => 1,
-);
-$item2 = array(
- "q" => array("try" => 3),
- "limit" => 1,
-);
-
-
-$batch = new MongoDeleteBatch($collection);
-$batch->add($item1);
-$batch->add($item2);
-$batch->execute(array("w" => 1));
-?>
-]]>
-
-
-
-
-
-
-
-
-
diff --git a/reference/mongo/mongowritebatch/construct.xml b/reference/mongo/mongowritebatch/construct.xml
deleted file mode 100644
index bfbe1bf877..0000000000
--- a/reference/mongo/mongowritebatch/construct.xml
+++ /dev/null
@@ -1,93 +0,0 @@
-
-
-
-
-
- MongoWriteBatch::__construct
- Creates a new batch of write operations
-
-
-
- &reftitle.description;
-
- protectedMongoWriteBatch::__construct
- MongoCollectioncollection
- stringbatch_type
- arraywrite_options
-
-
- Constructs a new MongoWriteBatch.
-
-
-
- This is a protected constructor. Please use one of the classes inheriting MongoWriteBatch.
-
-
-
-
-
-
- &reftitle.parameters;
-
-
- collection
- &mongo.mongowritebatch.collection.description;
-
-
- batch_type
-
-
- One of:
-
- 0 - make an MongoWriteBatch::COMMAND_INSERT batch
- 1 - make an MongoWriteBatch::COMMAND_UPDATE batch
- 2 - make a MongoWriteBatch::COMMAND_DELETE batch
-
-
-
-
-
- write_options
- &mongo.mongowritebatch.writeoptions.description;
-
-
-
-
-
- &reftitle.returnvalues;
-
- A new MongoWriteBatch of type batch_type.
-
-
-
-
- &reftitle.seealso;
-
- MongoInsertBatch
- MongoUpdateBatch
- MongoDeleteBatch
-
-
-
-
-
-
diff --git a/reference/mongo/mongowritebatch/execute.xml b/reference/mongo/mongowritebatch/execute.xml
deleted file mode 100644
index 1437117728..0000000000
--- a/reference/mongo/mongowritebatch/execute.xml
+++ /dev/null
@@ -1,261 +0,0 @@
-
-
-
-
-
- MongoWriteBatch::execute
- Executes a batch of write operations
-
-
-
- &reftitle.description;
-
- finalpublicarrayMongoWriteBatch::execute
- arraywrite_options
-
-
- Executes the batch of write operations.
-
-
-
-
-
- &reftitle.parameters;
-
-
- write_options
-
-
- See MongoWriteBatch::__construct.
-
-
-
-
-
-
-
- &reftitle.returnvalues;
-
- Returns an array containing statistical information for the full batch.
- If the batch had to be split into multiple batches, the return value will aggregate
- the values from individual batches and return only the totals.
-
-
- If the batch was empty, an array containing only the 'ok' field is returned (as &true;) although
- nothing will be shipped over the wire (NOOP).
-
-
-
-
-
- Array key
- Value meaning
- Returned for batch type
-
-
-
-
- nInserted
- Number of inserted documents
- MongoWriteBatch::COMMAND_INSERT batch
-
-
- nMatched
- Number of documents matching the query criteria
- MongoWriteBatch::COMMAND_UPDATE batch
-
-
- nModified
- Number of documents actually needed to be modied
- MongoWriteBatch::COMMAND_UPDATE batch
-
-
- nUpserted
- Number of upserted documents
- MongoWriteBatch::COMMAND_UPDATE batch
-
-
- nRemoved
- Number of documents removed
- MongoWriteBatch::COMMAND_DELETE batch
-
-
- ok
- Command success indicator
- All
-
-
-
-
-
-
-
- &reftitle.errors;
-
- A MongoWriteConcernException exception is thrown on failure.
-
-
-
-
- &reftitle.examples;
-
- MongoWriteBatch::add example
-
- Batching up multiple insert operations
-
-
-selectCollection("test", "test");
-
-
-$docs = array();
-$docs[] = array("my" => "demo");
-$docs[] = array("is" => "working");
-$docs[] = array("pretty" => "well");
-
-$batch = new MongoInsertBatch($collection);
-foreach($docs as $document) {
- $batch->add($document);
-}
-$retval = $batch->execute(array("w" => 1));
-var_dump($retval);
-?>
-]]>
-
- &example.outputs;
-
-
- int(3)
- ["ok"]=>
- bool(true)
-}
-]]>
-
-
-
-
- MongoWriteBatch::add example
-
- Batching up multiple update operations
-
-
-selectCollection("test", "test");
-
-
-$item1 = array(
- "q" => array("my" => "demo"),
- "u" => array('$set' => array("try" => 1)),
- "multi" => false, /* default value */
- "upsert" => false, /* default value */
-);
-$item2 = array(
- "q" => array("is" => "working"),
- "u" => array('$set' => array("try" => 2)),
- "multi" => true,
-);
-$item3 = array(
- "q" => array("created" => "new-document"),
- "u" => array('$set' => array("try" => 3)),
- "upsert" => true,
-);
-
-$batch = new MongoUpdateBatch($collection);
-$batch->add($item1);
-$batch->add($item2);
-$batch->add($item3);
-$retval = $batch->execute(array("w" => 1));
-var_dump($retval);
-
-?>
-]]>
-
- &example.outputs;
-
-
- int(18)
- ["nModified"]=>
- int(2)
- ["nUpserted"]=>
- int(0)
- ["ok"]=>
- bool(true)
-}
-]]>
-
-
-
-
- MongoWriteBatch::add example
-
- Batching up multiple delete operations
-
-
-selectCollection("test", "test");
-
-
-$item1 = array(
- "q" => array("my" => "demo"),
- "limit" => 1,
-);
-$item2 = array(
- "q" => array("try" => 3),
- "limit" => 1,
-);
-
-
-$batch = new MongoDeleteBatch($collection);
-$batch->add($item1);
-$batch->add($item2);
-$retval = $batch->execute(array("w" => 1));
-var_dump($retval);
-?>
-]]>
-
- &example.outputs;
-
-
- int(1)
- ["ok"]=>
- bool(true)
-}
-]]>
-
-
-
-
-
-
-
diff --git a/reference/mongo/mongowriteconcernexception.xml b/reference/mongo/mongowriteconcernexception.xml
deleted file mode 100644
index 21fc3ffff5..0000000000
--- a/reference/mongo/mongowriteconcernexception.xml
+++ /dev/null
@@ -1,82 +0,0 @@
-
-
-
-
-
- The MongoWriteConcernException class
- MongoWriteConcernException
-
-
-
-
-
- &reftitle.intro;
-
- MongoWriteConcernException is thrown when a write fails. See for how to set failure thresholds.
-
-
- Prior to MongoDB 2.6.0, the getLastError command would determine whether a write failed.
-
-
-
-
-
- &reftitle.classsynopsis;
-
-
-
- MongoWriteConcernException
-
-
-
-
- MongoWriteConcernException
-
-
-
- extends
- MongoCursorException
-
-
-
- &InheritedProperties;
-
-
-
- &Methods;
-
-
- &InheritedMethods;
-
-
-
-
-
-
-
-
-
- &reference.mongo.entities.mongowriteconcernexception;
-
-
-
-
diff --git a/reference/mongo/mongowriteconcernexception/getdocument.xml b/reference/mongo/mongowriteconcernexception/getdocument.xml
deleted file mode 100644
index dac57cbccf..0000000000
--- a/reference/mongo/mongowriteconcernexception/getdocument.xml
+++ /dev/null
@@ -1,56 +0,0 @@
-
-
-
-
-
- MongoWriteConcernException::getDocument
- Get the error document
-
-
-
- &reftitle.description;
-
- publicarrayMongoWriteConcernException::getDocument
-
-
-
- Returns the actual response from the server that was interperated as an error.
-
-
-
-
-
- &reftitle.parameters;
- &no.function.parameters;
-
-
-
- &reftitle.returnvalues;
-
- A MongoDB document, if available, as an array.
-
-
-
-
-
-
-
diff --git a/reference/mongo/queries.xml b/reference/mongo/queries.xml
deleted file mode 100644
index 3777b41cc5..0000000000
--- a/reference/mongo/queries.xml
+++ /dev/null
@@ -1,382 +0,0 @@
-
-
-
- Querying
-
-
- Distributing queries to secondaries
-
-
- All queries (reads and writes) are only sent to the primary member of a
- replica set by default. This is however easily configurable by using the
- Read Preferences which allow
- you to set some generic read preferences (such as allowing secondary reads
- of the nearest server), and also provide ways to specifically target a
- server in a specific country, datacenter, or even hardware, by the use of
- replica set tag sets.
-
-
- Read preferences can be configured at every level of the driver:
-
- As a query parameter or option to MongoClient::__construct
- Specifically by calling MongoClient::setReadPreference
- At the database level with MongoDB::setReadPreference
- At the collection level with MongoCollection::setReadPreference
- At the cursor level with MongoCursor::setReadPreference or MongoCommandCursor::setReadPreference
-
- Each class inherits its read preference setting from the "parent" context.
-
-
- Inheriting read preferences from the database level down to the cursor
-
-setReadPreference(MongoClient::RP_SECONDARY_PREFERRED);
-$c = $db->myCollection;
-
-$cursor = $c->find();
-?>
-]]>
-
-
-
- In this example, the query will be executed against a secondary. The
- collection inherits MongoClient::RP_SECONDARY_PREFERRED
- from the database and the cursor inherits it from the collection.
-
-
-
-
- How secondaries are chosen
-
-
- Each instance of MongoClient chooses its own
- secondary using the available secondary with the lowest ping time. So, if we
- had a PHP client in Europe and one in Australia and we had one secondary in
- each of these data centers, we could do:
-
-
-
- "setName", "readPreference" => MongoClient::RP_SECONDARY_PREFERRED);
-
-// on the Australian client
-$m = new MongoClient("mongodb://primary,australianhost.secondary,europeanhost.secondary", $options);
-$cursor = $m->foo->bar->find();
-$cursor->getNext();
-echo "Reading from: ", $cursor->info()["server"], "\n";
-
-// on the European client
-$m = new MongoClient("mongodb://primary,australianhost.secondary,europeanhost.secondary", $options);
-$cursor = $m->foo->bar->find();
-$cursor->getNext();
-echo "Reading from: ", $cursor->info()["server"], "\n";
-?>
-]]>
-
- &example.outputs.similar;
-
-
-
-
- Note that we have to do a query before a secondary is chosen: secondaries
- are chosen lazily by the driver, and for each query separately.
-
-
-
-
- You can see what the driver thinks is the current status of the set
- members by running MongoClient::getHosts or
- MongoClient::getConnections.
-
-
-
- If no secondary is readable, the driver will send reads to the
- primary as we specified
- MongoClient::RP_SECONDARY_PREFERRED which will
- fallback to execute a query on a primary if no secondaries are available.
- A server is considered readable if its state is 2 (SECONDARY) and its
- health is 1. You can check this with
- MongoClient::getHosts and
- MongoClient::getConnections.
-
-
-
-
- Random notes
-
-
- Writes are always sent to the primary—and by default all reads are sent
- to the primary too.
-
-
-
-
-
- Querying by _id
-
- Every object inserted is automatically assigned a unique
- _id field, which is often a useful field to use in
- queries. This works similarly to "get last insert ID" functionality, except
- that the _id is chosen by the client.
-
-
- Suppose that we wish to find the document we just inserted. Inserting adds
- an _id field to the document, so we can query by that:
-
-
-
- "joe");
-
-$people->insert($person);
-
-// now $joe has an _id field
-$joe = $people->findOne(array("_id" => $person['_id']));
-?>
-]]>
-
-
-
-
- Unless the user has specified otherwise, the _id field is a
- MongoId. The most common mistake is attempting to use
- a string to match a MongoId. Keep in mind that these
- are two different datatypes, and will not match each other in the same way
- that the string "array()" is not the same as an empty array. For example:
-
-
-
- "joe");
-
-$people->insert($person);
-
-// convert the _id to a string
-$pid = $person['_id'] . "";
-
-// FAILS - $pid is a string, not a MongoId
-$joe = $people->findOne(array("_id" => $pid));
-?>
-]]>
-
-
-
-
-
-
- Arrays
-
-
- Arrays are special in a couple ways. First, there are two types that
- MongoDB uses: "normal" arrays and associative arrays. Associative arrays can
- have any mix of key types and values. "Normal" arrays are defined as arrays
- with ascending numeric indexes starting at 0 and increasing by one for each
- element. These are, typically, just your usual PHP array.
-
-
-
- For instance, if you want to save a list of awards in a document, you could
- say:
-
-
-
-
-save(array("awards" => array("gold", "silver", "bronze")));
-
-?>
-]]>
-
-
-
-
- Queries can reach into arrays to search for elements. Suppose that we wish
- to find all documents with an array element of a given value. For example,
- documents with a "gold" award, such as:
-
-
-
-
-
-
-
- This can be done with a simple query, ignoring the fact that "awards" is an
- array:
-
-
-
-
-find(array("awards" => "gold"));
-
-?>
-]]>
-
-
-
-
- Suppose we are querying for a more complex object, if each element of the
- array were an object itself, such as:
-
-
-
-
-
-
-
- Still ignoring that this is an array, we can use dot notation to query the
- subobject:
-
-
-
-
-find(array("awards.first place" => "gold"));
-
-?>
-]]>
-
-
-
-
- Notice that it doesn't matter that there is a space in the field name
- (although it may be best not to use spaces, just to make things more
- readable).
-
-
-
- You can also use an array to query for a number of possible values. For
- instance, if we were looking for documents "gold" or "copper", we could do:
-
-
-
-
-find(array("awards" => array('$in' => array("gold", "copper"))));
-
-?>
-]]>
-
-
-
-
-
- &reftitle.changelog;
-
-
-
-
- &Version;
- &Description;
-
-
-
-
-
- 1.3.0
-
- Introduced the Read
- Preferences framework to allow more fine grained control over
- secondary reads.
-
-
-
- 1.3.0
-
- Deprecated slaveOkay usage, the alternative is Read Preferences.
-
-
-
- 1.1.0
-
- Introduced the possiblity of routing reads to secondaries of replica set
- members using Mongo::setSlaveOkay
-
-
-
-
-
-
-
-
-
-
-
diff --git a/reference/mongo/readpreferences.xml b/reference/mongo/readpreferences.xml
deleted file mode 100644
index 0213ba186c..0000000000
--- a/reference/mongo/readpreferences.xml
+++ /dev/null
@@ -1,312 +0,0 @@
-
-
-
-
- Read Preferences
-
- MongoDB 2.2 and version 1.3.0 of the driver add support for
- read preferences,
- which allow control over how queries are directed to mongod instances in a
- replica set environment. Read preferences may be specified on either a
- per-connection, per-database, or per-collection basis. Preferences defined
- at a higher level
- will be inherited by default (e.g. MongoCollection will
- inherit read preferences defined on the corresponding
- MongoDB instance).
-
-
- Read preferences are specified with a combination of modes and tag sets. Modes
- determine how mongod instances are prioritized, while
- tag sets specify criteria
- for eligible mongod instances. Mongod instances are only eligible if they
- are within a 15ms difference in ping time from the nearest mongod instance.
-
-
- Read Preference Modes
-
-
- All read preference modes except MongoClient::RP_PRIMARY
- may return stale data as secondaries replicate operations from the primary
- with some delay. Ensure that your application can tolerate stale data if you
- choose to use a mode other than MongoClient::RP_PRIMARY.
-
-
-
-
-
- MongoClient::RP_PRIMARY
-
-
- All read operations use only the current replica set primary. This is the
- default. If the primary is unavailable, read operations will produce an
- exception.
-
-
- This mode is incompatible with use of tag sets. Specifying a tag set with
- MongoClient::RP_PRIMARY will result in an exception.
-
-
-
-
- MongoClient::RP_PRIMARY_PREFERRED
-
-
- In most situations, operations read from the primary member of the set.
- However, if the primary is unavailable, as is the case during failover
- situations, operations read from secondary members.
-
-
- When the read preference includes a tag set, the client reads first from
- the primary, if available, and then from secondaries that match the
- specified tags. If no secondaries have matching tags, the read operation
- will produce an exception.
-
-
-
- Version 2.2 of mongos added full support for read preferences. When
- connecting to older mongos instances,
- MongoClient::RP_PRIMARY_PREFERRED will send queries to
- secondaries.
-
-
-
-
-
- MongoClient::RP_SECONDARY
-
-
- Operations read only from the secondary members of the set. If no
- secondaries are available, read operations will produce an exception.
-
-
- Most sets have at least one secondary, but there are situations where
- there may be no available secondary. For example, a set with a primary, a
- secondary, and an arbiter may not have any secondaries if a member is in
- recovering state or unavailable.
-
-
- When the read preference includes a tag set, the client attempts to find
- secondary members that match the specified tag set and directs reads to a
- random secondary from among the nearest group. If no secondaries have
- matching tags, the read operation will produce an exception.
-
-
-
-
- MongoClient::RP_SECONDARY_PREFERRED
-
-
- In most situations, operations read from secondary members, but in
- situations where the set consists of a single primary with no other
- members, the read operation will use the set's primary.
-
-
- When the read preference includes a tag set, the client attempts to find a
- secondary member that matches the specified tag set and directs reads to a
- random secondary from among the nearest group. If no secondaries have
- matching tags, the read operation will produce an exception.
-
-
-
-
- MongoClient::RP_NEAREST
-
-
- The driver reads from a random member of the set
- that has a ping time that is less than 15ms slower than the member with
- the lowest ping time. Reads in the
- MongoClient::RP_NEAREST mode do not consider the
- member's type and may read from both primaries and secondaries.
-
-
- Set this mode to minimize the effect of network latency on read operations
- without preference for current or stale data.
-
-
- If you specify a tag set, the client attempts to find a member
- that matches the specified tag set and directs reads to a random node
- from among the nearest group.
-
-
-
- All operations read from the nearest member of the replica set that
- matches the specified read preference mode. The
- MongoClient::RP_NEAREST mode prefers low latency reads
- over a member's primary or secondary status.
-
-
-
-
-
-
- Tag Sets
-
- Tag sets allow you to
- specify criteria so that your application can target read operations to
- specific members, based on custom parameters. Tag sets make it possible to
- ensure that read operations target members in a particular data center or
- target mongod instances designated for a particular class of operations, such
- as reporting or analytics.
-
-
- You can specify tag sets with the following read preference modes:
-
-
-
-
- MongoClient::RP_PRIMARY_PREFERRED
-
-
-
-
- MongoClient::RP_SECONDARY
-
-
-
-
- MongoClient::RP_SECONDARY_PREFERRED
-
-
-
-
- MongoClient::RP_NEAREST
-
-
-
-
- You cannot specify tag sets with the
- MongoClient::RP_PRIMARY read preference mode. Tags apply
- only when selecting a secondary member of a set, except for the when in the
- nearest mode.
-
-
-
- Specifying Read Preferences
-
- Read preferences may be specified in either the connection URI provided to
- MongoClient::__construct, which uses a query string
- syntax, or via setter methods on the core classes, which use an array syntax
- for tag sets.
-
-
- When specifying read preference modes in a query string, the tag sets for
- the readPreferenceTags value should be a comma-delimited
- sequence of colon-delimited key/value pairs.
-
-
-
- Each tag set defined in the query string will use the
- readPreferenceTags name. Unlike how PHP might handle URL
- query strings, successive values for readPreferenceTags
- will not overwrite each other. The driver will collect tag sets in the order
- they appear in the query string.
-
-
-
-
- If the driver cannot find a matching tag set the read will fail! It is
- your responsibility of providing suitable fallback, such as an empty
- readPreferenceTags value to fallback to "no tag set
- preference".
-
-
-
-
- Connection URI read preferences with query string syntax
-
- 'rs'));
-
-// Pick the nearest server in the "east" data center
-$uri = 'mongodb://rs1.example.com,rs2.example.com/';
-$uri .= '?readPreference=nearest';
-$uri .= '&readPreferenceTags=dc:east';
-$m = new MongoClient($uri, array('replicaSet' => 'rs'));
-
-// Prefer the nearest server in the "east" data center also used for reporting,
-// but fall back to a server in the "west" data center
-$uri = 'mongodb://rs1.example.com,rs2.example.com/';
-$uri .= '?readPreference=nearest';
-$uri .= '&readPreferenceTags=dc:east,use:reporting';
-$uri .= '&readPreferenceTags=dc:west';
-$m = new MongoClient($uri, array('replicaSet' => 'rs'));
-
-// Prefer the nearest server in the "east" data center, then a server in the
-// "west" data center, and finally fall back to no tag set preference
-$uri = 'mongodb://rs1.example.com,rs2.example.com/';
-$uri .= '?readPreference=nearest';
-$uri .= '&readPreferenceTags=dc:east';
-$uri .= '&readPreferenceTags=dc:west';
-$uri .= '&readPreferenceTags=';
-$m = new MongoClient($uri, array('replicaSet' => 'rs'));
-?>
-]]>
-
-
-
-
-
- Setting read preferences with array syntax for tag sets
-
- 'rs',
-));
-
-// Prefer the nearest server with no tag preference
-$m->setReadPreference(MongoClient::RP_NEAREST, array());
-
-// Pick the nearest server in the "east" data center
-$m->setReadPreference(MongoClient::RP_NEAREST, array(
- array('dc' => 'east'),
-));
-
-// Prefer the nearest server in the "east" data center also used for reporting,
-// but fall back to a server in the "west" data center
-$m->setReadPreference(MongoClient::RP_NEAREST, array(
- array('dc' => 'east', 'use' => 'reporting'),
- array('dc' => 'west'),
-));
-
-// Prefer the nearest server in the "east" data center, then a server in the
-// "west" data center, and finally fall back to no tag set preference
-$m->setReadPreference(MongoClient::RP_NEAREST, array(
- array('dc' => 'east'),
- array('dc' => 'west'),
- array(),
-));
-?>
-]]>
-
-
-
-
-
-
-
-
diff --git a/reference/mongo/reference.xml b/reference/mongo/reference.xml
deleted file mode 100644
index 23a48bfb4f..0000000000
--- a/reference/mongo/reference.xml
+++ /dev/null
@@ -1,31 +0,0 @@
-
-
-
-
- Mongo &Functions;
-
- &reference.mongo.entities.functions;
-
-
-
-
-
diff --git a/reference/mongo/security.xml b/reference/mongo/security.xml
deleted file mode 100644
index 7f453dc45a..0000000000
--- a/reference/mongo/security.xml
+++ /dev/null
@@ -1,169 +0,0 @@
-
-
-
-
- Security
-
-
- Request Injection Attacks
-
- If you are passing $_GET (or $_POST)
- parameters to your queries, make sure that they are cast to strings first.
- Users can insert associative arrays in GET and POST requests, which could
- then become unwanted $-queries.
-
-
-
- A fairly innocuous example: suppose you are looking up a user's information
- with the request http://www.example.com?username=bob.
- Your application does the query
- $collection->find(array("username" => $_GET['username'])).
-
-
-
- Someone could subvert this by getting
- http://www.example.com?username[$ne]=foo, which PHP
- will magically turn into an associative array, turning your query into
- $collection->find(array("username" => array('$ne' => "foo"))),
- which will return all users not named "foo" (all of your users, probably).
-
-
-
- This is a fairly easy attack to defend against: make sure $_GET and $_POST
- parameters are the type you expect before you send them to the database
- (cast them to strings, in this case).
-
-
-
- Note that this type of attack can be used with any databases interation that
- locates a document, including updates, upserts, find-and-modifies, and
- removes.
-
-
-
- Thanks to Phil for pointing this out.
-
-
-
- See the main documentation
- for more information about SQL-injection-like issues with MongoDB.
-
-
-
-
- Script Injection Attacks
-
- If you are using JavaScript, make sure that any variables that cross the PHP-
- to-JavaScript boundry are passed in the scope field of
- MongoCode, not interpolated into the JavaScript
- string. This can come up when using MongoDB::execute,
- $where clauses, MapReduces, group-bys, and any other time
- you may pass JavaScript into the database.
-
-
-
- MapReduce ignore the scope field of
- MongoCode, but there is a scope
- option on the command that can be used instead.
-
-
-
- For example, suppose we have some JavaScript to greet a user in the database
- logs. We could do:
-
-
-execute("print('Hello, $username!');");
-
-?>
-]]>
-
-
- However, what if a malicious user passes in some JavaScript?
-
-
-execute("print('Hello, $username!');");
-
-?>
-]]>
-
-
- Now MongoDB executes the JavaScript string
- "print('Hello, '); db.users.drop(); print('!');".
- This attack is easy to avoid: use scope to pass
- variables from PHP to JavaScript:
-
-
- $username);
-$db->execute(new MongoCode("print('Hello, '+user+'!');", $scope));
-
-?>
-]]>
-
-
- This adds a variable user to the JavaScript scope. Now if
- someone tries to send malicious code, MongoDB will harmlessly print
- Hello, '); db.dropDatabase(); print('!.
-
-
-
- Using scope helps prevent malicious input from being
- executed by the database. However, you must make sure that your code does
- not turn around and execute the input anyway! For example, never use the
- JavaScript eval function on user input:
-
-
- $jsShellInput);
-$db->execute(new MongoCode("eval(input);", $scope));
-
-?>
-]]>
-
-
- Always use scope and never allow the database to execute
- user input as code.
-
-
-
-
-
-
diff --git a/reference/mongo/setup.xml b/reference/mongo/setup.xml
deleted file mode 100644
index 25d3c5bb05..0000000000
--- a/reference/mongo/setup.xml
+++ /dev/null
@@ -1,49 +0,0 @@
-
-
-
-
-
- &reftitle.setup;
-
-
- &mongo.deprecated.note;
-
-
-
-
- &reftitle.required;
- &no.requirement;
-
-
-
-
- &reference.mongo.configure;
-
-
-
- &reference.mongo.ini;
-
-
-
-
-
-
diff --git a/reference/mongo/sqltomongo.xml b/reference/mongo/sqltomongo.xml
deleted file mode 100644
index 1e89dfd86d..0000000000
--- a/reference/mongo/sqltomongo.xml
+++ /dev/null
@@ -1,254 +0,0 @@
-
-
-
- SQL to Mongo Mapping Chart
-
- This is a PHP-specific version of the
- SQL to Mongo
- mapping chart in the main docs.
-
-
-
-
-
-
- SQL Statement
- Mongo Query Language Statement
-
-
-
-
-
-
- CREATE TABLE USERS (a Number, b Number)
-
-
- Implicit or use MongoDB::createCollection.
-
-
-
-
- INSERT INTO USERS VALUES(1,1)
-
-
- $db->users->insert(array("a" => 1, "b" => 1));
-
-
-
-
- SELECT a,b FROM users
-
-
- $db->users->find(array(), array("a" => 1, "b" => 1));
-
-
-
-
- SELECT * FROM users WHERE age=33
-
-
- $db->users->find(array("age" => 33));
-
-
-
-
- SELECT a,b FROM users WHERE age=33
-
-
- $db->users->find(array("age" => 33), array("a" => 1, "b" => 1));
-
-
-
-
- SELECT a,b FROM users WHERE age=33 ORDER BY name
-
-
- $db->users->find(array("age" => 33), array("a" => 1, "b" => 1))->sort(array("name" => 1));
-
-
-
-
- SELECT * FROM users WHERE age>33
-
-
- $db->users->find(array("age" => array('$gt' => 33)));
-
-
-
-
- SELECT * FROM users WHERE age<33
-
-
- $db->users->find(array("age" => array('$lt' => 33)));
-
-
-
-
- SELECT * FROM users WHERE name LIKE "%Joe%"
-
-
- $db->users->find(array("name" => new MongoRegex("/Joe/")));
-
-
-
-
- SELECT * FROM users WHERE name LIKE "Joe%"
-
-
- $db->users->find(array("name" => new MongoRegex("/^Joe/")));
-
-
-
-
- SELECT * FROM users WHERE age>33 AND age<=40
-
-
- $db->users->find(array("age" => array('$gt' => 33, '$lte' => 40)));
-
-
-
-
- SELECT * FROM users ORDER BY name DESC
-
-
- $db->users->find()->sort(array("name" => -1));
-
-
-
-
- CREATE INDEX myindexname ON users(name)
-
-
- $db->users->ensureIndex(array("name" => 1));
-
-
-
-
- CREATE INDEX myindexname ON users(name,ts DESC)
-
-
- $db->users->ensureIndex(array("name" => 1, "ts" => -1));
-
-
-
-
- SELECT * FROM users WHERE a=1 and b='q'
-
-
- $db->users->find(array("a" => 1, "b" => "q"));
-
-
-
-
- SELECT * FROM users LIMIT 20, 10
-
-
- $db->users->find()->limit(10)->skip(20);
-
-
-
-
- SELECT * FROM users WHERE a=1 or b=2
-
-
- $db->users->find(array('$or' => array(array("a" => 1), array("b" => 2))));
-
-
-
-
- SELECT * FROM users LIMIT 1
-
-
- $db->users->find()->limit(1);
-
-
-
-
- EXPLAIN SELECT * FROM users WHERE z=3
-
-
- $db->users->find(array("z" => 3))->explain()
-
-
-
-
- SELECT DISTINCT last_name FROM users
-
-
- $db->command(array("distinct" => "users", "key" => "last_name"));
-
-
-
-
- SELECT COUNT(*y) FROM users
-
-
- $db->users->count();
-
-
-
-
- SELECT COUNT(*y) FROM users where AGE > 30
-
-
- $db->users->find(array("age" => array('$gt' => 30)))->count();
-
-
-
-
- SELECT COUNT(AGE) from users
-
-
- $db->users->find(array("age" => array('$exists' => true)))->count();
-
-
-
-
- UPDATE users SET a=1 WHERE b='q'
-
-
- $db->users->update(array("b" => "q"), array('$set' => array("a" => 1)));
-
-
-
-
- UPDATE users SET a=a+2 WHERE b='q'
-
-
- $db->users->update(array("b" => "q"), array('$inc' => array("a" => 2)));
-
-
-
-
- DELETE FROM users WHERE z="abc"
-
-
- $db->users->remove(array("z" => "abc"));
-
-
-
-
-
-
-
-
-
diff --git a/reference/mongo/testing.xml b/reference/mongo/testing.xml
deleted file mode 100644
index 135f8b4133..0000000000
--- a/reference/mongo/testing.xml
+++ /dev/null
@@ -1,61 +0,0 @@
-
-
-
-
- Running the Driver's Tests
-
-
- The PECL package does not come with the tests, but they are available at
- Github.
-
-
-
- .phpt Tests
-
- .phpt tests are the standard way of testing PHP extensions. After compiling
- the MongoDB driver with "make" you can then issue "make test" to run the
- tests. These tests require MongoDB to be working, and hence, you need to
- configure the test suite itself.
-
-
- There is more information on running the tests in the contributing
- guidelines on
- GitHub.
-
-
-
-
- Reporting Errors
-
- Please report any failures or errors in the
- bugtracker. There may be skipped
- tests, these are normal and can be ignored.
-
-
- New tests are always welcome! Please feel free to contribute new tests of any
- type testing any functionality.
-
-
-
-
-
-
diff --git a/reference/mongo/trouble.xml b/reference/mongo/trouble.xml
deleted file mode 100644
index 948e3d22c9..0000000000
--- a/reference/mongo/trouble.xml
+++ /dev/null
@@ -1,63 +0,0 @@
-
-
-
-
- Troubleshooting
-
-
- If you're having trouble, there are lots of resources you can turn to.
-
-
-
-
- IRC
-
- The official MongoDB IRC room is irc.freenode.net/#mongodb. This is the
- fastest way to get help.
-
-
-
- Mailing List
-
- MongoDB's mailing list
- is a good (and usually very fast) way to get answers to questions.
-
-
-
- Bug Tracker
-
- Found a bug? Want a feature? Have a question? File it in the
- PHP driver's bug tracker.
-
-
-
-
-
- You can make the driver log all kinds of error messages as
- E_NOTICE level PHP error messages. Have a look at
- the MongoLog for an example.
-
-
-
-
-
-
diff --git a/reference/mongo/tutorial.xml b/reference/mongo/tutorial.xml
deleted file mode 100644
index d0ceb20edd..0000000000
--- a/reference/mongo/tutorial.xml
+++ /dev/null
@@ -1,576 +0,0 @@
-
-
-
-
- Tutorial
-
- &mongo.deprecated.note;
-
-
- This is the official MongoDB driver for PHP.
-
- Here's a quick code sample that connects, inserts documents, queries for
- documents, iterates through query results, and disconnects from MongoDB.
- There are more details on each step in the tutorial below.
-
-
-
-comedy;
-
-// select a collection (analogous to a relational database's table)
-$collection = $db->cartoons;
-
-// add a record
-$document = array( "title" => "Calvin and Hobbes", "author" => "Bill Watterson" );
-$collection->insert($document);
-
-// add another record, with a different "shape"
-$document = array( "title" => "XKCD", "online" => true );
-$collection->insert($document);
-
-// find everything in the collection
-$cursor = $collection->find();
-
-// iterate through the results
-foreach ($cursor as $document) {
- echo $document["title"] . "\n";
-}
-
-?>
-]]>
-
- &example.outputs;
-
-
-
-
-
-
-
- Making a Connection
-
- To connect to the database server, use one of the following:
-
-
-
-
-
-]]>
-
-
-
- You do not have to explicitly disconnect from the database. The driver uses
- persistent connections and will re-use already established connections.
-
-
- See Also
-
- The chapter on connecting
- covers different types of connections.
-
-
- The API documentation on the MongoClient class and
- MongoClient::__construct give a comprehensive look at
- all possible options with a number of examples.
-
-
-
-
-
- Getting a Database
-
- To select a database, use:
-
-
-
-dbname;
-?>
-]]>
-
-
-
- The database does not need to be created in advance, you can create new
- databases by selecting them.
-
-
- Be careful of typos! You can inadvertently create a new database, which can
- cause confusing errors (here name is misspelled as
- anme in the second selection:
-
-
-
-mybiglongdbname;
-// do some stuff
-
-$db = $connection->mybiglongdbanme;
-// now connected to a different database!
-?>
-]]>
-
-
-
-
- See Also
-
- The API documentation on the MongoDB class contains
- more information about database objects.
-
-
-
-
-
- Getting A Collection
-
- Getting a collection has the same syntax as getting a database:
-
-
-
-baz;
-
-// select a collection:
-$collection = $db->foobar;
-
-// or, directly selecting a database and collection:
-$collection = $connection->baz->foobar;
-?>
-]]>
-
-
-
- A collection is analogous to a table (if you are familiar with relational
- databases).
-
-
- See Also
-
- The API documentation on the MongoCollection class
- contains more information about collection objects.
-
-
-
-
-
- Inserting a Document
-
- Associative arrays are the basic object that can be saved to a collection in
- the database. A somewhat random "document" might be:
-
-
-
- "MongoDB",
- "type" => "database",
- "count" => 1,
- "info" => (object)array( "x" => 203, "y" => 102),
- "versions" => array("0.9.7", "0.9.8", "0.9.9")
-);
-?>
-]]>
-
-
-
- Note that you can have nested arrays and objects. The driver will always
- store an associative array as an object in the database. A
- numerically indexed array is stored as an array in case the keys start at
- 0 and are not interrupted, and as an object if the array keys don't start
- at 0 or have gaps (ie: 0, 1, 4, 5).
-
-
- To insert this document, use MongoCollection::insert:
-
-
-
-database->collectionName;
-
-$collection->insert( $doc );
-?>
-]]>
-
-
-
- See Also
-
- The API documentation on MongoCollection::insert
- contains more information about inserting data.
-
-
-
-
-
-
- Finding Documents using MongoCollection::findOne
-
-
- To show that the document we inserted in the previous step is stored in
- the database, we can do a simple
- MongoCollection::findOne operation to get a single
- document from the collection. This method is useful when there is only one
- document matching the query or you are only interested in one result.
-
-
-
-database->collectionName;
-
-$document = $collection->findOne();
-var_dump( $document );
-?>
-]]>
-
- &example.outputs;
-
-
- object(MongoId)#8 (1) {
- ["$id"]=>
- string(24) "4e2995576803fab768000000"
- }
- ["name"]=>
- string(7) "MongoDB"
- ["type"]=>
- string(8) "database"
- ["count"]=>
- int(1)
- ["info"]=>
- array(2) {
- ["x"]=>
- int(203)
- ["y"]=>
- int(102)
- }
- ["versions"]=>
- array(3) {
- [0]=>
- string(5) "0.9.7"
- [1]=>
- string(5) "0.9.8"
- [2]=>
- string(5) "0.9.9"
- }
-}
-]]>
-
-
-
- Note that there is an _id field that has been added
- automatically to your document. _id is the "primary key"
- field. If your document does not specify one, the driver will add one
- automatically.
-
-
- If you specify your own _id field, it must be unique to
- the collection. See the example here:
-
-
-
-database;
-
-$db->foo->insert(array("_id" => 1));
-// this will throw an exception
-$db->foo->insert(array("_id" => 1));
-
-// this is fine, as it is a different collection
-$db->bar->insert(array("_id" => 1));
-?>
-]]>
-
-
-
- By default the driver will ensure the server has acknowledged the write
- before returning. You can optionally turn this behaviour off by passing
- array("w" => 0) as the second argument. This means that
- the driver should not wait for the database to acknowledge the write and
- would not throw the duplicate _id exception.
-
-
- See Also
-
- MongoCollection::findOne for more information about
- finding data.
-
-
- MongoId goes into more detail on unique ids.
-
-
- The writes section covers
- writes in more depth, and the
- chapter goes into details of the various Write Concern options.
-
-
-
-
-
- Adding Multiple Documents
-
- In order to do more interesting things with queries, let's add multiple
- simple documents to the collection. These documents will just be of the form
- array( "i" => value ); and we
- can do this fairly efficiently in a loop:
-
-
-
-database->collectionName;
-
-for ( $i = 0; $i < 100; $i++ )
-{
- $collection->insert( array( 'i' => $i, "field{$i}" => $i * 2 ) );
-}
-?>
-]]>
-
-
-
-
- Notice that we can insert arrays with different keys into the same
- collection. This aspect is what we mean when we say that MongoDB is
- "schema-free". In the example above each document has an
- i field, but also a field name in the form of
- field + $i.
-
-
-
-
- Counting Documents in A Collection
-
- Now that we've inserted 101 documents (the 100 we did in the loop, plus the
- first one), we can check to see if we have them all using the
- MongoCollection::count method.
-
-
-database->collectionName;
-
-echo $collection->count();
-?>
-]]>
-
-
- and it should print 101.
-
-
-
-
- Using a Cursor to Get All of the Documents
-
- In order to get all the documents in the collection, we will use
- MongoCollection::find. The find() method returns a
- MongoCursor object which allows us to iterate over the
- set of documents that matched our query. So to query all of the documents and
- print them out:
-
-
-
-database->collectionName;
-
-$cursor = $collection->find();
-foreach ( $cursor as $id => $value )
-{
- echo "$id: ";
- var_dump( $value );
-}
-?>
-]]>
-
-
-
- and that should print all 101 documents in the collection.
- $id is the _id field of a document
- (cast to a string) and $value is the document itself.
-
-
- See Also
-
- The API documentation on MongoCollection::find
- contains more information about finding data.
-
-
-
-
-
- Setting Criteria for a Query
-
- We can create a query to pass to the
- MongoCollection::find method to get a subset of the
- documents in our collection. For example, if we wanted to find the document
- for which the value of the "i" field is
- 71, we would do the following:
-
-
-
-database->collectionName;
-
-$query = array( 'i' => 71 );
-$cursor = $collection->find( $query );
-
-while ( $cursor->hasNext() )
-{
- var_dump( $cursor->getNext() );
-}
-?>
-]]>
-
- &example.outputs;
-
-
- object(MongoId)#6 (0) {
- }
- ["i"]=>
- int(71)
- ["_ns"]=>
- "testCollection"
-}
-]]>
-
-
-
-
-
- Getting A Set of Documents With a Query
-
- We can use the query to get a set of documents from our collection. For
- example, if we wanted to get all documents where "i"
- > 50, we could write:
-
-
-
-database->collectionName;
-
-$query = array( "i" => array( '$gt' => 50 ) ); //note the single quotes around '$gt'
-$cursor = $collection->find( $query );
-
-while ( $cursor->hasNext() )
-{
- var_dump( $cursor->getNext() );
-}
-?>
-]]>
-
-
- which should print the documents where "i" >
- 50. We could also get a range, say
- 20 < i <= 30:
-
-
-database->collectionName;
-
-$query = array( 'i' => array( '$gt' => 20, "\$lte" => 30 ) );
-$cursor = $collection->find( $query );
-
-while ( $cursor->hasNext() )
-{
- var_dump( $cursor->getNext() );
-}
-?>
-]]>
-
-
-
- Remember to always escape the $-symbol or use single quotes. Otherwise PHP
- will interpret it to be the variable $gt.
-
-
-
-
- Creating An Index
-
- MongoDB supports indexes, and they are very easy to add on a collection. To
- create an index, you specify the field name and direction: ascending (1) or
- descending (-1). The following creates an ascending index on the "i" field:
-
-
-
-database->collectionName;
-
-$collection->ensureIndex( array( "i" => 1 ) ); // create index on "i"
-$collection->ensureIndex( array( "i" => -1, "j" => 1 ) ); // index on "i" descending, "j" ascending
-?>
-]]>
-
-
-
- Indexing is critical for good read performance as your data grows. If you
- are not familiar with indexing, check out the
- MongoCollection::ensureIndex documentation and the core
- MongoDB indexing documentation.
-
-
-
-
-
diff --git a/reference/mongo/types.xml b/reference/mongo/types.xml
deleted file mode 100644
index ffc191da08..0000000000
--- a/reference/mongo/types.xml
+++ /dev/null
@@ -1,317 +0,0 @@
-
-
-
-
-
- Types
-
-
-
-
- MongoDB allows programmers to save and query for data expressed in all of the
- basic PHP types, compound types (arrays, associative arrays, and objects), and
- a half-dozen classes provided by the MongoDB PHP driver (for regular
- expressions, dates, and other specialized applications).
-
-
-
-
- Booleans and &null;
-
- &true;, &false;, and &null; can be used as-is.
-
-
-
-
- Numbers
-
- Numbers are distinct from strings in MongoDB: "123" does not match 123.
- Thus, if you want to make sure numbers are sorted and matched correctly, you
- must make sure that they are actually saved as numbers.
-
-
- 123, "b" => "123");
-$collection->insert($doc);
-
-$doc->find(array("a" => 123)); // matches
-$doc->find(array("a" => "123")); // doesn't match
-$doc->find(array("a" => 123.0)); // matches
-$doc->find(array("b" => 123)); // doesn't match
-$doc->find(array("b" => "123")); // matches
-
-?>
-]]>
-
-
- As noted above, floating point numbers do compare with/match integer numbers
- as one would expect.
-
-
- Large Numbers
-
- By default, on a 32-bit system, numbers are sent to the database as 32-bit
- integers. On a 64-bit system, they are sent as 64-bit integers. For
- backwards compatibility, all systems deserialize 64-bit integers as floating
- point numbers. Floating point numbers are not exact. If you need exact
- values, you must tweak your
- php.ini settings.
-
-
- On a 32-bit system, if mongo.long_as_object is set,
- 64-bit integers will be returns as MongoInt64
- objects. The integer will be stored in the value field
- with perfect precision (as a string). You can also use
- MongoInt64 to save 64-bit integers on 32-bit
- machines.
-
-
- On 64-bit systems, you can either set mongo.long_as_object
- or set mongo.native_long.
- mongo.native_long will return 64-bit integers and
- "normal" PHP integers. You can use MongoInt32 to
- save 32-bit integers on 64-bit machines.
-
-
- You should set the mongo.long_as_object and
- mongo.native_long behavior that you plan to use, even if
- it is the default behavior (to protect against future changes to the
- defaults).
-
-
- See also: php.ini Options,
- MongoInt32, MongoInt64.
-
-
-
-
-
- Strings
-
- Strings must be UTF-8. Non-UTF-8 strings must either be converted to UTF-8
- before being sent to the database or saved as binary data.
-
-
- Regular expressions can be used to match strings, and are expressed using the
- MongoRegex class.
-
-
-
-
- Binary Data
-
- Non-UTF-8 strings, images, and any other binary data should be sent to the
- database using the MongoBinData type.
-
-
-
-
- Dates
-
- Dates can be created using the MongoDate class. They
- are stored as milliseconds since the epoch.
-
-
- MongoTimestamp is not for saving dates or timestamps,
- it is used internally by MongoDB. Unless you are creating a tool that
- interacts with the internals of replication or sharding, you should use
- MongoDate, not
- MongoTimestamp.
-
-
-
-
- Unique Ids
-
- The driver will automatically create an _id field before
- inserting a document (unless one is specified by the user). This field is an
- instance of MongoId (called "ObjectId" in most other
- languages).
-
-
- These ids are 12 bytes long and composed of:
-
-
- 4 bytes of timestamp
-
- No two records can have the same id if they were inserted at different
- times.
-
-
-
- 3 bytes machine id
-
- No two records can have the same id if they were inserted on different
- machines
-
-
-
- 2 bytes thread id
-
- No two records can have the same id if they were inserted by different
- threads running on the same machine.
-
-
-
- 3 bytes incrementing value
-
- Each time an id is created, a global counter is incremented and used
- as the increment value of the next id.
-
-
-
- Thus, no two records can have the same id unless a single process on a
- single machine managed to insert 256^3 (over 16 million) documents in
- one second, overflowing the increment field.
-
-
-
-
- JavaScript
-
- MongoDB comes with a JavaScript engine, so you can embed JavaScript in
- queries (using a $where clause), send it directly to the database to be
- executed, and use it to perform aggregations.
-
-
- For security, use MongoCode's scope
- field to use PHP variables in JavaScript. Code that does not require
- external values can either use MongoCode or just be
- a string. See the
- section on security for more
- information about sending JavaScript to the database.
-
-
-
-
- Arrays and Objects
-
-
- Arrays and objects can also be saved to the database. An array with ascending
- numeric keys will be saved as a an array, anything else will be saved as an
- object.
-
-
-
-insert(array("scores" => $scores));
-
-// $scores will be saved as an object
-$scores = array("quiz1" => 98, "midterm" => 100, "quiz2" => 73, "final" => 85);
-$collection->insert(array("scores" => $scores));
-
-?>
-]]>
-
-
-
- If you query for these objects using the database shell, they will look like:
-
- db.students.find()
-{ "_id" : ObjectId("4b06beada9ad6390dab17c43"), "scores" : [ 98, 100, 73, 85 ] }
-{ "_id" : ObjectId("4b06bebea9ad6390dab17c44"), "scores" : { "quiz1" : 98, "midterm" : 100, "quiz2" : 73, "final" : 85 } }
-]]>
-
-
-
-
- The database can also save arbitrary PHP objects (although they will be
- returned as associative arrays). The fields are used for the key/value
- pairs. For example, a blog post might look like:
-
-author = $author;
-$this->content = $content;
- $this->date = new MongoDate();
- }
-
- public function setTitle($title) {
- $this->title = $title;
- }
-}
-
-// create a simple blog post and insert it into the database
-$post1 = new Post("Adam", "This is a blog post");
-
-$blog->insert($post1);
-
-
-// there is nothing restricting the type of the "author" field, so we can make
-// it a nested object
-$author = array("name" => "Fred", "karma" => 42);
-$post2 = new Post($author, "This is another blog post.");
-
-// we create an extra field by setting the title
-$post2->setTitle("Second Post");
-
-$blog->insert($post2);
-
-?>
-]]>
-
-
-
-
- From the database shell, this will look something like:
-
- db.blog.find()
-{ "_id" : ObjectId("4b06c263edb87a281e09dad8"), "author" : "Adam", "content" : "This is a blog post", "comments" : [ ], "date" : "Fri Nov 20 2009 11:22:59 GMT-0500 (EST)" }
-{ "_id" : ObjectId("4b06c282edb87a281e09dad9"), "author" : { "name" : "Fred", "karma" : 42 }, "content" : "This is a blog post", "comments" : [ ], "date" : "Fri Nov 20 2009 11:23:30 GMT-0500 (EST)", "title" : "Second Post" }
-]]>
-
-
-
-
- The driver will not detect reference loops in arrays and objects. For
- example, this will give a fatal error:
-
-insert($GLOBALS);
-
-?>
-]]>
-
-
-
-
- If you need to insert documents that may have recursive dependency, you have
- to check for it yourself before passing it to the driver.
-
-
-
- &reference.mongo.mongoid;
- &reference.mongo.mongocode;
- &reference.mongo.mongodate;
- &reference.mongo.mongoregex;
- &reference.mongo.mongobindata;
- &reference.mongo.mongoint32;
- &reference.mongo.mongoint64;
- &reference.mongo.mongodbref;
- &reference.mongo.mongominkey;
- &reference.mongo.mongomaxkey;
- &reference.mongo.mongotimestamp;
-
-
diff --git a/reference/mongo/updates.xml b/reference/mongo/updates.xml
deleted file mode 100644
index 1d4bc2eb94..0000000000
--- a/reference/mongo/updates.xml
+++ /dev/null
@@ -1,163 +0,0 @@
-
-
-
-
- Updates
-
-
- Updates can be one of the most complicated operation available with
- MongoDB. They combine a query with an action, modifying documents that match
- the criteria. They are also extremely powerful, allowing you to change
- documents quickly and replace them altogether. They are done in-place (when
- possible) with little overhead.
-
-
-
- Modifying vs. replacing documents
-
-
- There are two types of updates you can use: modifying updates and replacing
- updates. Modifying updates contain $-operators and change fields in a
- document: they might increment counters, push new elements onto an array,
- or change the type of a field.
-
-
-
- For example, a modifying update could add a new field to a document.
-
-update(array("username" => "joe"), array('$set' => array("twitter" => "@joe4153")));
-
-/** now the document will look like:
- * {"username" : "joe", "password" : "...", "email" : "...", "twitter" : "@joe4153"}
- */
-?>
-]]>
-
-
-
-
- Replacing updates replace the entire matching document with a new document.
- They are generally not as efficient as using $-modifiers, but can be very
- usefully for complex operations or updates that can't be expressed in terms
- of $-operators.
-
-
-
- For example, a replacing update can completely change the structure of a
- document.
-
-update(array("username" => "joe"), array("userId" => 12345, "info" => array(
- "name" => "joe", "twitter" => "@joe4153", "email" => "..."), "likes" => array()));
-
-/** now the document will look like:
- * {
- * "userId" : 12345,
- * "info" : {
- * "name" : "joe",
- * "twitter" : "@joe4153",
- * "email" : "..."
- * },
- * "likes" : []
- * }
- */
-?>
-]]>
-
-
-
-
-
-
- Updating Nested Objects
-
-
- Suppose we wish to change the name of a comment's author in this document:
-
-
-
-
-
- In order to change an inner field, we use $set (so that all of the other
- fields are not removed!) with the index of comment to change:
-
-
-update($criteria, array('$set' => array("comments.1" => array("author" => "Jim"))));
-
-?>
-]]>
-
-
-
-
-
- The Positional Operator
-
- The positional operator $ is useful for updating objects
- that are in arrays. In the example above, for instance, suppose that we did
- not know the index of the comment that we needed to change, merely that we
- needed to change "John" to "Jim". We can use $ to do so.
-
-
-update(
- array("comments.author" => "John"),
- array('$set' => array('comments.$.author' => "Jim")));
-
-?>
-]]>
-
-
-
-
-
-
diff --git a/reference/mongo/versions.xml b/reference/mongo/versions.xml
deleted file mode 100644
index bc89f67668..0000000000
--- a/reference/mongo/versions.xml
+++ /dev/null
@@ -1,342 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/reference/mongo/writeconcerns.xml b/reference/mongo/writeconcerns.xml
deleted file mode 100644
index 81507f32ae..0000000000
--- a/reference/mongo/writeconcerns.xml
+++ /dev/null
@@ -1,413 +0,0 @@
-
-
-
-
- Write Concerns
-
-
- MongoDB provides several different ways of selecting how durable a write to
- the database should be. These ways are called Write
- Concerns and span everything from completely ignoring all errors,
- to specifically targetting which servers are required to confirm the write
- before returning the operation.
-
-
- When a write (such as with MongoCollection::insert,
- MongoCollection::update, and
- MongoCollection::remove) is given a Write Concern
- option ("w") the driver will send the query to MongoDB
- and piggy back a getLastError command
- (GLE) with the Write Concern option at the same time.
- The server only returns when the Write Concern condition is verified to be
- fulfilled, or the query times out (controlled with the
- "wtimeout" option, 10000 milliseconds
- is the default).
-
-
-
-
- Even though a getLastError command times out the data
- will most likely have been written to the primary server and will be
- replicated to all the secondaries once they have caught up.
-
-
- The typical reasons for a timeout to happen is if you specify a Write
- Concern which requires confirmation from more servers then you currently
- have available.
-
-
-
-
- When using acknowledged writes and the replica set has failed over, the driver
- will automatically disconnect from the primary, throw an exception, and
- attempt to find a new primary on the next operation (your application must
- decide whether or not to retry the operation on the new primary).
-
-
- When using unacknowledged writes (w=0) and the replica set has failed over,
- there will be no way for the driver to know about the change so it will
- continue and silently fail to write.
-
-
- The default Write Concern for the MongoClient is
- 1: acknowledge write operations.
-
-
-
-
-
- Available Write Concerns
-
-
-
- Write Concern
- Meaning
- Description
-
-
-
-
-
- w=0
- Unacknowledged
- A write will not be followed up with a GLE call, and therefore not checked ("fire and forget")
-
-
- w=1
- Acknowledged
- The write will be acknowledged by the server (the primary on replica set configuration)
-
-
- w=N
- Replica Set Acknowledged
- The write will be acknowledged by the primary server, and
- replicated to N-1 secondaries.
-
-
- w=majority
- Majority Acknowledged
- The write will be acknowledged by the majority of the replica set (including the primary). This is a special reserved string.
-
-
- w=<tag set>
- Replica Set Tag Set Acknowledged
- The write will be acknowledged by members of the entire tag set
-
-
- j=true
- Journaled
- The write will be acknowledged by primary and the journal flushed to disk
-
-
-
-
-
-
-
- Using WriteConcerns
-
- Each of the methods that causes writes
- (MongoCollection::insert,
- MongoCollection::update,
- MongoCollection::remove, and
- MongoCollection::batchInsert) allow an optional
- argument to send a set of options to the MongoDB server. With this option
- array you can set the WriteConcern as the following example illustrates:
-
-
- Passing a WriteConcern to a write operation
-
-insert($someDoc, array("w" => 0));
-
-// Setting w=majority for update:
-$collection->update($someDoc, $someUpdates, array("w" => "majority"));
-
-// Setting w=5 and j=true for remove:
-$collection->update($someDoc, array("w" => 5, "j" => true));
-
-// Setting w="AllDCs" for batchInsert:
-$collection->update(array($someDoc1, $someDoc2), array("w" => "AllDCs"));
-?>
-]]>
-
-
-
- Besides setting WriteConcerns per operation as an option argument, it is
- also possible to set a default WriteConcern in different ways.
-
-
- The first way is through the connection
- string. The connection string accepts the
- journal, w, and
- wTimeoutMS options:
-
-
- Connection string WriteConcerns
-
-
-]]>
-
-
-
-
- Since driver version 1.5 it is also possible to call
- MongoDB::setWriteConcern and
- MongoCollection::setWriteConcern to set a default
- WriteConcern for all operations created from that specific
- MongoDB or MongoCollection
- object:
-
-
- MongoDB::setWriteConcern and MongoCollection::setWriteConcern
-
-demoDb;
-$c = $d->demoCollection;
-
-// Set w=3 on the database object with a timeout of 25000ms
-$d->setWriteConcern(3, 25000);
-
-// Set w=majority on the collection object without changing the timeout
-$c->setWriteConcern("majority");
-?>
-]]>
-
-
-
-
-
- Unacknowledged Writes
-
- By not requiring the server to acknowledge writes the writes can be performed
- extremely quickly, but you don't know whether or not they actually succeeded.
- Writes can fail for a number of reasons: if there are network problems, if a
- database server goes down, or if the write was simply invalid (e.g., writing
- to a system collection; or duplicate key errors).
-
-
- While developing, you should always use acknowledged writes (to protect against
- inadvertent mistakes, such as syntax errors, invalid operators, duplicate key errors and so on). In
- production, unacknowledged writes can be used for "unimportant" data. Unimportant
- data varies on application, but it's generally automatically (instead of user
- generated) data, such as click tracking or GPS locations, where you can get
- thousands of records per second.
-
-
- It is strongly recommended that you do an acknowledged write at the end of
- series of unacknowledged writes. Doing so will not incur in a too large
- performance penalty, but still allow you to catch any errors that may have
- occurred.
-
-
- Unacknowledged WriteConcern, followed with Acknowledged Write
-
-insert($someDoc, array("w" => 0));
-$collection->update($criteria, $newObj, array("w" => 0));
-$collection->insert($somethingElse, array("w" => 0));
-try {
- $collection->remove($something, array("w" => 1));
-} catch(MongoCursorException $e) {
- /* Handle the exception.. */
- /* Here we should issue find() queries on the IDs generated for
- $somethingElse and $someDoc to verify they got written to the database and
- attempt to figureout where in the chain something happened. */
-}
-?>
-]]>
-
-
- If the last write throws an exception, you know that there's a problem
- with your database.
-
-
-
-
-
- Acknowledged Writes
-
- These type of write operations will make sure that the database has
- accepted the write operation before returning success. If the write failed,
- it will throw a MongoCursorException with an
- explanation of the failure. The MongoClient default
- behaviour is to acknowledge the write (w=1).
-
-
- It is possible to specify how many members of an replica set have to
- acknowledge the write (i.e. have it replicated) before the write is deemed
- acknowledged and the operation returns.
-
- Acknowledged Writes
-
-insert($doc, array("w" => 1));
-
-// Force acknowledgement from the primary, and one other member of the
-// replica set
-$collection->insert($doc, array("w" => 2));
-
-// Force acknowledgement from the primary, and six other members of the
-// replica set (you probably never should do this):
-$collection->insert($doc, array("w" => 7));
-?>
-]]>
-
-
- Keep in mind to select your Write Concern carefully. If you have a
- replica set with 5 members, and you select Write Concern of
- 4 you will risk the write blocking forever when one
- member of the replica set goes down for maintenance or a temporary network
- outage happens.
-
-
-
-
-
- Passing in a string value for Write Concern has a specific meaning
- (Replica Set Tag Set Acknowledged). Please be careful of
- NOT using string values for numbers (i.e.
- array("w" => "1")) as it will be treated as a tag set
- name.
-
-
-
-
-
- Majority Acknowledged Writes
-
- Using the special majority Write Concern option is the
- recommended way for writes that are required to survive the apocalypse, as
- it will ensure the majority of your replica set will have the write and will
- therefore be guaranteed to survive all usual suspect outage scenarios.
-
-
- Majority Acknowledged Write
-
-insert($someDoc, array("w" => "majority"));
-?>
-]]>
-
-
-
-
-
-
-
- Journaled Writes
-
- When connecting to a replica set the default Write Concern is only to have
- the primary server acknowledge the write. There is however a 100ms window
- until the write gets journaled and flushed to disk. It is possible to force
- the write to be journaled before acknowledging the write by setting the
- j option:
-
- Acknowledged and Journaled Write
- Forcing journal flush
-
- 1,
- "j" => true,
-);
-try {
- $collection->insert($document, $options);
-} catch(MongoCursorException $e) {
- /* handle the exception */
-}
-?>
-]]>
-
-
-
-
-
-
- &reftitle.seealso;
-
-
- MongoDB WriteConcern docs
-
-
-
-
-
- &reftitle.changelog;
-
-
-
-
- &Version;
- &Description;
-
-
-
-
- 1.3.0
-
- MongoClient was introduced and defaults to
- acknowledged writes.
- The deprecated Mongo defaults to unacknowledged
- writes.
-
-
-
- 1.3.0
-
- The "safe" write option has been deprecated and is
- not available with the new MongoClient class.
- Use the "w" option instead.
-
-
-
-
-
-
-
-
-
-
-
diff --git a/reference/mongo/writes.xml b/reference/mongo/writes.xml
deleted file mode 100644
index e17bb12fb6..0000000000
--- a/reference/mongo/writes.xml
+++ /dev/null
@@ -1,90 +0,0 @@
-
-
-
-
- Writes
-
- Updating Nested Objects
-
-
- Suppose we wish to change the name of a comment's author in this document:
-
-
-
-
-
- In order to change an inner field, we use $set (so that all of the other
- fields are not removed!) with the index of comment to change:
-
-
-update($criteria, array('$set' => array("comments.1" => array("author" => "Jim"))));
-
-?>
-]]>
-
-
-
-
-
- The Positional Operator
-
- The positional operator $ is useful for updating objects
- that are in arrays. In the example above, for instance, suppose that we did
- not know the index of the comment that we needed to change, merely that we
- needed to change "John" to "Jim". We can use $ to do so.
-
-
-update(
- array('comments.author' => 'John'),
- array('$set' => array('comments.$.author' => 'Jim')));
-
-?>
-]]>
-
-
-
-
-
-
-
diff --git a/reference/mongodb/architecture.xml b/reference/mongodb/architecture.xml
index 5d70ca3909..2fad6372c3 100644
--- a/reference/mongodb/architecture.xml
+++ b/reference/mongodb/architecture.xml
@@ -13,8 +13,8 @@
This section explains how all the different parts of the driver fit
together. From the different language runtimes, through the extension and
to the PHP libraries on top. This new architecture has replaced the old
- mongo extension. We refer to the new one
- as the mongodb extension.
+ mongo extension. We refer to the new one
+ as the mongodb extension.
@@ -513,16 +513,15 @@ class UpperClass implements MongoDB\BSON\Persistable {
Deserialization from BSON
- The legacy mongo extension deserialized
+ The legacy mongo extension deserialized
both BSON documents and arrays as PHP arrays. While PHP arrays are
convenient to work with, this behavior was problematic because different
BSON types could deserialize to the same PHP value (e.g.
- {"0": "foo"} and ["foo"]) and make it
+ {"0": "foo"} and ["foo"]) and make it
impossible to infer the original BSON type. By default, the current driver
addresses this concern by ensuring that BSON arrays and documents are
converted to PHP arrays and objects, respectively.
-
For compound types, there are three data types:
diff --git a/reference/mongodb/set.xml b/reference/mongodb/set.xml
index 448f42e58c..576d2e8922 100644
--- a/reference/mongodb/set.xml
+++ b/reference/mongodb/set.xml
@@ -8,8 +8,7 @@
- Unlike the mongo extension, this
- extension is developed atop the
+ This extension is developed atop the
libmongoc and
libbson libraries.
It provides a minimal API for core driver functionality: