From f8e05c6db91926587c7881f5b07e78975cc047f7 Mon Sep 17 00:00:00 2001 From: Kristina Chodorow Date: Wed, 20 May 2009 22:31:40 +0000 Subject: [PATCH] added most of the oop stuff for mongo 0.9.0 git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@280887 c90b9560-bf6c-de11-be94-00142212c4b1 --- reference/mongo/book.xml | 12 +- reference/mongo/functions/mongo-connect.xml | 167 ----------------- reference/mongo/functions/mongo-find-one.xml | 165 ---------------- .../mongo/functions/mongo-gridfile-write.xml | 104 ----------- .../mongo/functions/mongo-gridfs-init.xml | 127 ------------- reference/mongo/functions/mongo-has-next.xml | 108 ----------- reference/mongo/functions/mongo-insert.xml | 128 ------------- reference/mongo/functions/mongo-next.xml | 115 ------------ reference/mongo/functions/mongo-query.xml | 176 ------------------ reference/mongo/functions/mongo-remove.xml | 130 ------------- reference/mongo/functions/mongo-update.xml | 152 --------------- reference/mongo/ini.xml | 31 ++- reference/mongo/mongo.xml | 78 ++++++++ reference/mongo/mongo/close.xml | 48 +++++ reference/mongo/mongo/connect.xml | 56 ++++++ .../connectutil.xml} | 45 ++--- reference/mongo/mongo/construct.xml | 102 ++++++++++ reference/mongo/mongo/dropdb.xml | 61 ++++++ reference/mongo/mongo/forceerror.xml | 48 +++++ reference/mongo/mongo/lasterror.xml | 48 +++++ reference/mongo/mongo/pairconnect.xml | 60 ++++++ reference/mongo/mongo/pairpersistconnect.xml | 80 ++++++++ reference/mongo/mongo/persistconnect.xml | 80 ++++++++ reference/mongo/mongo/preverror.xml | 48 +++++ reference/mongo/mongo/repairdb.xml | 83 +++++++++ reference/mongo/mongo/reseterror.xml | 48 +++++ reference/mongo/mongo/selectcollection.xml | 88 +++++++++ reference/mongo/mongo/selectdb.xml | 69 +++++++ reference/mongo/mongo/tostring.xml | 48 +++++ reference/mongo/mongobindata/construct.xml | 4 +- reference/mongo/mongocollection.xml | 72 +++++++ .../mongo/mongocollection/batchinsert.xml | 100 ++++++++++ reference/mongo/mongocollection/construct.xml | 83 +++++++++ reference/mongo/mongocollection/count.xml | 48 +++++ .../mongo/mongocollection/createdbref.xml | 61 ++++++ .../mongo/mongocollection/deleteindex.xml | 92 +++++++++ .../mongo/mongocollection/deleteindexes.xml | 49 +++++ reference/mongo/mongocollection/drop.xml | 51 +++++ .../mongo/mongocollection/ensureindex.xml | 93 +++++++++ reference/mongo/mongocollection/find.xml | 71 +++++++ reference/mongo/mongocollection/findone.xml | 60 ++++++ reference/mongo/mongocollection/getdbref.xml | 61 ++++++ .../mongo/mongocollection/getindexinfo.xml | 48 +++++ reference/mongo/mongocollection/getname.xml | 73 ++++++++ reference/mongo/mongocollection/insert.xml | 61 ++++++ reference/mongo/mongocollection/remove.xml | 71 +++++++ .../save.xml} | 42 ++--- reference/mongo/mongocollection/tostring.xml | 73 ++++++++ reference/mongo/mongocollection/update.xml | 82 ++++++++ reference/mongo/mongocollection/validate.xml | 61 ++++++ reference/mongo/mongocursor.xml | 86 +++++++++ reference/mongo/mongocursor/construct.xml | 95 ++++++++++ reference/mongo/mongocursor/current.xml | 48 +++++ reference/mongo/mongocursor/doquery.xml | 48 +++++ reference/mongo/mongocursor/getnext.xml | 48 +++++ reference/mongo/mongocursor/hasnext.xml | 48 +++++ reference/mongo/mongocursor/hint.xml | 68 +++++++ reference/mongo/mongocursor/limit.xml | 69 +++++++ reference/mongo/mongocursor/next.xml | 48 +++++ reference/mongo/mongocursor/reset.xml | 48 +++++ reference/mongo/mongocursor/rewind.xml | 48 +++++ reference/mongo/mongocursor/skip.xml | 69 +++++++ reference/mongo/mongocursor/softlimit.xml | 89 +++++++++ reference/mongo/mongocursor/sort.xml | 93 +++++++++ reference/mongo/mongocursor/valid.xml | 48 +++++ reference/mongo/mongodb.xml | 83 +++++++++ reference/mongo/mongodb/construct.xml | 81 ++++++++ reference/mongo/mongodb/createcollection.xml | 91 +++++++++ reference/mongo/mongodb/createdbref.xml | 72 +++++++ reference/mongo/mongodb/drop.xml | 48 +++++ reference/mongo/mongodb/dropcollection.xml | 58 ++++++ reference/mongo/mongodb/execute.xml | 72 +++++++ reference/mongo/mongodb/getcursorinfo.xml | 45 +++++ reference/mongo/mongodb/getdbref.xml | 61 ++++++ reference/mongo/mongodb/getgridfs.xml | 73 ++++++++ reference/mongo/mongodb/getprofilinglevel.xml | 48 +++++ reference/mongo/mongodb/listcollections.xml | 45 +++++ reference/mongo/mongodb/repair.xml | 72 +++++++ reference/mongo/mongodb/selectcollection.xml | 58 ++++++ reference/mongo/mongodb/setprofilinglevel.xml | 61 ++++++ reference/mongo/mongodb/tostring.xml | 48 +++++ reference/mongo/mongogridfs.xml | 68 +++++++ reference/mongo/mongogridfs/construct.xml | 96 ++++++++++ reference/mongo/mongogridfs/drop.xml | 49 +++++ reference/mongo/mongogridfs/find.xml | 73 ++++++++ reference/mongo/mongogridfs/findone.xml | 62 ++++++ reference/mongo/mongogridfs/remove.xml | 73 ++++++++ reference/mongo/mongogridfs/storefile.xml | 73 ++++++++ reference/mongo/mongogridfs/storeupload.xml | 72 +++++++ reference/mongo/mongogridfsfile.xml | 67 +++++++ reference/mongo/mongogridfsfile/construct.xml | 71 +++++++ reference/mongo/mongogridfsfile/getbytes.xml | 52 ++++++ .../mongo/mongogridfsfile/getfilename.xml | 45 +++++ reference/mongo/mongogridfsfile/getsize.xml | 45 +++++ reference/mongo/mongogridfsfile/write.xml | 59 ++++++ reference/mongo/mongoutil.xml | 67 +++++++ reference/mongo/mongoutil/dbcommand.xml | 81 ++++++++ reference/mongo/mongoutil/toindexstring.xml | 58 ++++++ reference/mongo/versions.xml | 102 ++++++++-- 99 files changed, 5593 insertions(+), 1450 deletions(-) delete mode 100644 reference/mongo/functions/mongo-connect.xml delete mode 100644 reference/mongo/functions/mongo-find-one.xml delete mode 100644 reference/mongo/functions/mongo-gridfile-write.xml delete mode 100644 reference/mongo/functions/mongo-gridfs-init.xml delete mode 100644 reference/mongo/functions/mongo-has-next.xml delete mode 100644 reference/mongo/functions/mongo-insert.xml delete mode 100644 reference/mongo/functions/mongo-next.xml delete mode 100644 reference/mongo/functions/mongo-query.xml delete mode 100644 reference/mongo/functions/mongo-remove.xml delete mode 100644 reference/mongo/functions/mongo-update.xml create mode 100644 reference/mongo/mongo.xml create mode 100644 reference/mongo/mongo/close.xml create mode 100644 reference/mongo/mongo/connect.xml rename reference/mongo/{functions/mongo-gridfs-store.xml => mongo/connectutil.xml} (52%) create mode 100644 reference/mongo/mongo/construct.xml create mode 100644 reference/mongo/mongo/dropdb.xml create mode 100644 reference/mongo/mongo/forceerror.xml create mode 100644 reference/mongo/mongo/lasterror.xml create mode 100644 reference/mongo/mongo/pairconnect.xml create mode 100644 reference/mongo/mongo/pairpersistconnect.xml create mode 100644 reference/mongo/mongo/persistconnect.xml create mode 100644 reference/mongo/mongo/preverror.xml create mode 100644 reference/mongo/mongo/repairdb.xml create mode 100644 reference/mongo/mongo/reseterror.xml create mode 100644 reference/mongo/mongo/selectcollection.xml create mode 100644 reference/mongo/mongo/selectdb.xml create mode 100644 reference/mongo/mongo/tostring.xml create mode 100644 reference/mongo/mongocollection.xml create mode 100644 reference/mongo/mongocollection/batchinsert.xml create mode 100644 reference/mongo/mongocollection/construct.xml create mode 100644 reference/mongo/mongocollection/count.xml create mode 100644 reference/mongo/mongocollection/createdbref.xml create mode 100644 reference/mongo/mongocollection/deleteindex.xml create mode 100644 reference/mongo/mongocollection/deleteindexes.xml create mode 100644 reference/mongo/mongocollection/drop.xml create mode 100644 reference/mongo/mongocollection/ensureindex.xml create mode 100644 reference/mongo/mongocollection/find.xml create mode 100644 reference/mongo/mongocollection/findone.xml create mode 100644 reference/mongo/mongocollection/getdbref.xml create mode 100644 reference/mongo/mongocollection/getindexinfo.xml create mode 100644 reference/mongo/mongocollection/getname.xml create mode 100644 reference/mongo/mongocollection/insert.xml create mode 100644 reference/mongo/mongocollection/remove.xml rename reference/mongo/{functions/mongo-close.xml => mongocollection/save.xml} (56%) create mode 100644 reference/mongo/mongocollection/tostring.xml create mode 100644 reference/mongo/mongocollection/update.xml create mode 100644 reference/mongo/mongocollection/validate.xml create mode 100644 reference/mongo/mongocursor.xml create mode 100644 reference/mongo/mongocursor/construct.xml create mode 100644 reference/mongo/mongocursor/current.xml create mode 100644 reference/mongo/mongocursor/doquery.xml create mode 100644 reference/mongo/mongocursor/getnext.xml create mode 100644 reference/mongo/mongocursor/hasnext.xml create mode 100644 reference/mongo/mongocursor/hint.xml create mode 100644 reference/mongo/mongocursor/limit.xml create mode 100644 reference/mongo/mongocursor/next.xml create mode 100644 reference/mongo/mongocursor/reset.xml create mode 100644 reference/mongo/mongocursor/rewind.xml create mode 100644 reference/mongo/mongocursor/skip.xml create mode 100644 reference/mongo/mongocursor/softlimit.xml create mode 100644 reference/mongo/mongocursor/sort.xml create mode 100644 reference/mongo/mongocursor/valid.xml create mode 100644 reference/mongo/mongodb.xml create mode 100644 reference/mongo/mongodb/construct.xml create mode 100644 reference/mongo/mongodb/createcollection.xml create mode 100644 reference/mongo/mongodb/createdbref.xml create mode 100644 reference/mongo/mongodb/drop.xml create mode 100644 reference/mongo/mongodb/dropcollection.xml create mode 100644 reference/mongo/mongodb/execute.xml create mode 100644 reference/mongo/mongodb/getcursorinfo.xml create mode 100644 reference/mongo/mongodb/getdbref.xml create mode 100644 reference/mongo/mongodb/getgridfs.xml create mode 100644 reference/mongo/mongodb/getprofilinglevel.xml create mode 100644 reference/mongo/mongodb/listcollections.xml create mode 100644 reference/mongo/mongodb/repair.xml create mode 100644 reference/mongo/mongodb/selectcollection.xml create mode 100644 reference/mongo/mongodb/setprofilinglevel.xml create mode 100644 reference/mongo/mongodb/tostring.xml create mode 100644 reference/mongo/mongogridfs.xml create mode 100644 reference/mongo/mongogridfs/construct.xml create mode 100644 reference/mongo/mongogridfs/drop.xml create mode 100644 reference/mongo/mongogridfs/find.xml create mode 100644 reference/mongo/mongogridfs/findone.xml create mode 100644 reference/mongo/mongogridfs/remove.xml create mode 100644 reference/mongo/mongogridfs/storefile.xml create mode 100644 reference/mongo/mongogridfs/storeupload.xml create mode 100644 reference/mongo/mongogridfsfile.xml create mode 100644 reference/mongo/mongogridfsfile/construct.xml create mode 100644 reference/mongo/mongogridfsfile/getbytes.xml create mode 100644 reference/mongo/mongogridfsfile/getfilename.xml create mode 100644 reference/mongo/mongogridfsfile/getsize.xml create mode 100644 reference/mongo/mongogridfsfile/write.xml create mode 100644 reference/mongo/mongoutil.xml create mode 100644 reference/mongo/mongoutil/dbcommand.xml create mode 100644 reference/mongo/mongoutil/toindexstring.xml diff --git a/reference/mongo/book.xml b/reference/mongo/book.xml index 6161a7ff7a..4b9b42fb15 100644 --- a/reference/mongo/book.xml +++ b/reference/mongo/book.xml @@ -1,5 +1,5 @@ - + Mongo @@ -32,14 +32,20 @@ &reference.mongo.constants; &reference.mongo.examples; + &reference.mongo.mongo; + &reference.mongo.mongodb; + &reference.mongo.mongocollection; + &reference.mongo.mongocursor; + &reference.mongo.mongogridfs; + &reference.mongo.mongogridfsfile; + &reference.mongo.mongoutil; + &reference.mongo.mongocode; &reference.mongo.mongoid; &reference.mongo.mongodate; &reference.mongo.mongoregex; &reference.mongo.mongobindata; - &reference.mongo.reference; - - - - - mongo_connect - Connects to a database - - - - &reftitle.description; - - resourcemongo_connect - stringserver - stringusername - stringpassword - boolpersistent - boolpaired - boollazy - - - Creates a new database connection object. - - - - - &reftitle.parameters; - - - - - host - - - - Address of the database to which to connect. - - - - - - username - - - - An identifier for the connection. Only necessary for - persistent, authenticated connections, otherwise it can - be set to "". - - - - - - password - - - - An identifier for the connection. Only necessary for - persistent, authenticated connections, otherwise it can - be set to "". - - - - - - persistent - - - - If the connection should be persistent. - - - - - - paired - - - - If the paired database servers are being used. - - - - - - lazy - - - - If persistent and lazy are set and no existing - database connection is found, do not connect. - - - - - - - - - - If able to connect, the connection resource is returned. - Otherwise, false. - - - - - &reftitle.errors; - - If the server name is invalid (null or the empty string). - If the driver is unable to connect to the host. - - - - - &reftitle.examples; - - - <function>mongo_connect</function> example - - To connect to a Mongo database running locally on the default port: - - - -]]> - - - - - - - &reftitle.seealso; - - - mongo_close - - - - - - - diff --git a/reference/mongo/functions/mongo-find-one.xml b/reference/mongo/functions/mongo-find-one.xml deleted file mode 100644 index ae95bd63ef..0000000000 --- a/reference/mongo/functions/mongo-find-one.xml +++ /dev/null @@ -1,165 +0,0 @@ - - - - - - mongo_find_one - Queries the database for a single record - - - - &reftitle.description; - - arraymongo_find_one - resourceconnection - stringns - arrayquery - - - Queries the database for a single record. This can also be used for database commands. - - - - - &reftitle.parameters; - - - - connection - - - The database connection to use. - - - - - ns - - - A string of the form [database_name].[collection_name]. - - - - - query - - - An array representing the desired results. - - - - - - - - - &reftitle.returnvalues; - - Returns an array if an element matching the query was found, null otherwise. - - - - - &reftitle.examples; - - - <function>mongo_find_one</function> example - - This example shows how to find the most recently inserted record - in the collection "bar" in the database "foo". - - - "y" )); -var_dump(mongo_find_one($conn, "foo.bar", array())); - -?> -]]> - - &example.outputs.similar; - - - object(MongoId)#1 (1) { - ["id"]=> - string(24) "49a2e6f55b8b4a17e843cf3d" - } - ["x"]=> - string(1) "y" -} -]]> - - - - <function>mongo_find_one</function> example - - This example shows how to execute a database command using - the "foo" database. - - - 1))); - -?> -]]> - - &example.outputs.similar; - - - bool(false) - ["asserted"]=> - bool(false) - ["assert"]=> - string(0) "" - ["assertw"]=> - string(0) "" - ["assertmsg"]=> - string(0) "" - ["assertuser"]=> - string(0) "" - ["ok"]=> - float(1) -} -]]> - - - - - - - - diff --git a/reference/mongo/functions/mongo-gridfile-write.xml b/reference/mongo/functions/mongo-gridfile-write.xml deleted file mode 100644 index 804d016a52..0000000000 --- a/reference/mongo/functions/mongo-gridfile-write.xml +++ /dev/null @@ -1,104 +0,0 @@ - - - - - - mongo_gridfile_write - Write a file from the database to the local filesystem - - - - &reftitle.description; - - intmongo_gridfile_write - resourcegridfile - stringfilename - - - Write a file from the database to the local filesystem. - - - - - &reftitle.parameters; - - - - gridfile - - - The grid file. - - - - - filename - - - Name to save the file under. - - - - - - - - - &reftitle.returnvalues; - - Returns the number of bytes written. - - - - - &reftitle.examples; - - - <function>mongo_gridfile_write</function> example - - This example shows a file being retrieved from the database and - saved to the local filesystem. - - - "profilePic.jpg")); -mongo_gridfile_write($file, "pic.jpg"); - -?> -]]> - - - - - - - diff --git a/reference/mongo/functions/mongo-gridfs-init.xml b/reference/mongo/functions/mongo-gridfs-init.xml deleted file mode 100644 index 06ebd00885..0000000000 --- a/reference/mongo/functions/mongo-gridfs-init.xml +++ /dev/null @@ -1,127 +0,0 @@ - - - - - - mongo_gridfs_init - Creates a new gridfs connection - - - - &reftitle.description; - - resourcemongo_gridfs_init - resourceconnection - stringdb - stringprefix - - - Creates a new gridfs connection which can be used to interact with files in the database. - - - - - &reftitle.parameters; - - - - connection - - - The database connection to use. - - - - - db - - - The name of the database to use. - - - - - prefix - - - The prefix for the grid collections (usually "fs"). - - - - - - - - - &reftitle.returnvalues; - - A connection to the grid filesystem. - - - - - &reftitle.examples; - - - <function>mongo_gridfs_init</function> example - - This example creates a new connection and uses it to find a file - in the database. - - - "profilePic.jpg")); - -?> -]]> - - - $jpg will now be storing a file resource. - - - - - - - &reftitle.seealso; - - - mongo_gridfs_find - mongo_gridfs_list - mongo_gridfs_store - - - - - - - diff --git a/reference/mongo/functions/mongo-has-next.xml b/reference/mongo/functions/mongo-has-next.xml deleted file mode 100644 index 3b004138a7..0000000000 --- a/reference/mongo/functions/mongo-has-next.xml +++ /dev/null @@ -1,108 +0,0 @@ - - - - - - mongo_has_next - Checks if a cursor has any more documents to return - - - - &reftitle.description; - - boolmongo_has_next - resourcecursor - - - Checks if a cursor has any more documents to return. - - - - - &reftitle.parameters; - - - - cursor - - - The database cursor to check. - - - - - - - - - &reftitle.returnvalues; - - If there is another document to return. - - - - - &reftitle.examples; - - - <function>mongo_has_next</function> example - - This example shows how mongo_has_next can be used to - iterate through results. - - - -]]> - - - The above example will output a dot for each document in the collection foo.bar. - - - - - - - &reftitle.seealso; - - - mongo_query - mongo_next - - - - - - - diff --git a/reference/mongo/functions/mongo-insert.xml b/reference/mongo/functions/mongo-insert.xml deleted file mode 100644 index 026ce400b7..0000000000 --- a/reference/mongo/functions/mongo-insert.xml +++ /dev/null @@ -1,128 +0,0 @@ - - - - - - mongo_insert - Inserts an array into a database collection - - - - &reftitle.description; - - boolmongo_insert - resourceconnection - stringns - arrayquery - - - Inserts an array into a database collection. - - - - - &reftitle.parameters; - - - - connection - - - The database connection to use. - - - - - ns - - - The database and collection name - - - - - obj - - - The array to insert. - - - - - - - - - &reftitle.returnvalues; - - Whether the item was successfully inserted or not. - - - - - &reftitle.examples; - - - <function>mongo_insert</function> example - - This example shows how to insert an array into a database collection. - - - "y", "z" => 2.4); -$conn = mongo_connect("localhost", true); -if (!$conn) { - die("Could not connect."); -} -$ok = mongo_insert($conn, "foo.bar", $obj); -if( $ok ) { - echo "inserted"; -} - -?> -]]> - - &example.outputs.similar; - - - - - - - - - &reftitle.seealso; - - - mongo_update - mongo_remove - - - - - - - diff --git a/reference/mongo/functions/mongo-next.xml b/reference/mongo/functions/mongo-next.xml deleted file mode 100644 index b9408ce5e2..0000000000 --- a/reference/mongo/functions/mongo-next.xml +++ /dev/null @@ -1,115 +0,0 @@ - - - - - - mongo_next - Fetches the next document returned by a query - - - - &reftitle.description; - - arraymongo_next - resourcecursor - - - Fetches the next document returned by a query. - - - - - &reftitle.parameters; - - - - - cursor - - - - The cursor to use. - - - - - - - - - &reftitle.returnvalues; - - The next document. - - - - - &reftitle.errors; - - Creates an error if there are no more documents. - - - - - &reftitle.examples; - - - <function>mongo_next</function> example - - This example uses mongo_has_next and mongo_next to - iterate through query results and storing them in - an array. - - - -]]> - - - - - - - &reftitle.seealso; - - - mongo_has_next - - - - - - - diff --git a/reference/mongo/functions/mongo-query.xml b/reference/mongo/functions/mongo-query.xml deleted file mode 100644 index 3693a98e21..0000000000 --- a/reference/mongo/functions/mongo-query.xml +++ /dev/null @@ -1,176 +0,0 @@ - - - - - - mongo_query - Performs a basic database query - - - - &reftitle.description; - - resourcemongo_query - resourceconnection - stringns - arrayquery - intskip - intlimit - arraysort - arrayfields - arrayhint - - - Performs a database query, returning a database cursor that - can be passed to mongo_has_next or mongo_next. It is highly - suggested that users use MongoCollection's find() function - instead, as it is basically a wrapper for this function that - handles of the extensive parameter list for the user. - - - - - &reftitle.parameters; - - - - connection - - - The database connection to use. - - - - - ns - - - The database and collection name - - - - - query - - - The query to execute. - - - - - skip - - - The number of documents to skip. - - - - - limit - - - The maximum number of documents to return. - - - - - sort - - - An array of fields and directions on which to sort. - - - - - fields - - - An array of the fields of each document to return. - - - - - hint - - - An array giving the database a query hint. - - - - - - - - - &reftitle.returnvalues; - - Returns a cursor to the resulting documents. - - - - - &reftitle.examples; - - - <function>mongo_query</function> example - - This example shows how to use a query to get a page of - search results from the database. - - - $searchterm), ($pagenum-1)*$resultsPerPage, $resultsPerPage, null, null, null); - -?> -]]> - - - This returns results 11-20 of objects in the zoo.animals collection with the name field "panda". - - - - - - - &reftitle.seealso; - - - mongo_has_next - mongo_next - - - - - - - diff --git a/reference/mongo/functions/mongo-remove.xml b/reference/mongo/functions/mongo-remove.xml deleted file mode 100644 index 44c1e272b4..0000000000 --- a/reference/mongo/functions/mongo-remove.xml +++ /dev/null @@ -1,130 +0,0 @@ - - - - - - mongo_remove - Removes documents from a database collection - - - - &reftitle.description; - - boolmongo_remove - resourceconnection - stringns - arrayquery - booljustOne - - - Removes objects from a database collection based on criteria. - - - - - &reftitle.parameters; - - - - connection - - - The database connection to use. - - - - - ns - - - The database and collection name - - - - - query - - - Array of criteria for objects to remove. - - - - - justOne - - - If only one object matching the criteria should be removed. - - - - - - - - - &reftitle.returnvalues; - - If the remove was successful. - - - - - &reftitle.examples; - - - <function>mongo_remove</function> example - - In this example, all users named Doug are deleted from - the users collection of the www database. - - - "Doug"); - -$conn = mongo_connect("localhost", true); -if (!$conn) { - die("Could not connect."); -} -$ok = mongo_remove($conn, "www.users", $rquery, false); - -?> -]]> - - - - - - - &reftitle.seealso; - - - mongo_insert - mongo_update - - - - - - - diff --git a/reference/mongo/functions/mongo-update.xml b/reference/mongo/functions/mongo-update.xml deleted file mode 100644 index 0b0eaae588..0000000000 --- a/reference/mongo/functions/mongo-update.xml +++ /dev/null @@ -1,152 +0,0 @@ - - - - - - mongo_update - Updates objects in a database collection - - - - &reftitle.description; - - boolmongo_update - resourceconnection - stringns - arrayquery - arraynewobj - boolupsert - - - Removes matching objects, changes them to match a new object form, and - resaves them to the database. If there are no matching objects and - upsert is set, the new object will be inserted into the database. - - - - - &reftitle.parameters; - - - - connection - - - The database connection to use. - - - - - ns - - - The database and collection name - - - - - query - - - The object for which to query. - - - - - newobj - - - The object to replace matches with. - - - - - upsert - - - Whether to insert newobj into the collection - if no objects are returned by the query. - - - - - - - - - &reftitle.returnvalues; - - If the update was successful. - - - - - &reftitle.examples; - - - <function>mongo_update</function> example - - This example shows how to update an existing object. - - - "y"); -$newobj = array("x" => "z"); - -$conn = mongo_connect("localhost", true); -if (!$conn) { - die("Could not connect."); -} -$ok = mongo_update($conn, "foo.bar", $query, $newobj, false); -if( $ok ) { - echo "updated"; -} - - -?> -]]> - - &example.outputs.similar; - - - - - - - - - &reftitle.seealso; - - - mongo_insert - mongo_remove - - - - - - - diff --git a/reference/mongo/ini.xml b/reference/mongo/ini.xml index cb8f3f2b81..3c8cd479e4 100644 --- a/reference/mongo/ini.xml +++ b/reference/mongo/ini.xml @@ -1,5 +1,5 @@ - +
&reftitle.runtime; &extension.runtime; @@ -18,32 +18,37 @@ mongo.default_host - NULL + "localhost" PHP_INI_ALL mongo.default_port - NULL + 27017 PHP_INI_ALL mongo.auto_reconnect - NULL + 0 PHP_INI_SYSTEM mongo.allow_persistent - NULL + 1 PHP_INI_SYSTEM mongo.max_persistent - NULL + -1 PHP_INI_SYSTEM mongo.max_connections - NULL + -1 + PHP_INI_SYSTEM + + + mongo.chunk_size + 262144 PHP_INI_SYSTEM @@ -133,6 +138,18 @@ + + + mongo.chunk_size + int + + + + The number of bytes-per-chunk. Used in divvying up GridFS files. + + + +
diff --git a/reference/mongo/mongo.xml b/reference/mongo/mongo.xml new file mode 100644 index 0000000000..4db6afbf78 --- /dev/null +++ b/reference/mongo/mongo.xml @@ -0,0 +1,78 @@ + + + + + + The Mongo class + Mongo + + + +
+ &reftitle.intro; + + The connection point between MongoDB and PHP. + + + This class is used to initiate a connection and for database server commands. + A typical use is: + +selectDatabase(); // get a database object +?> +]]> + + +
+ + +
+ &reftitle.classsynopsis; + + + + Mongo + + + + + Mongo + + + + + Methods + + + + +
+ +
+ + &reference.mongo.entities.mongo; + +
+ + diff --git a/reference/mongo/mongo/close.xml b/reference/mongo/mongo/close.xml new file mode 100644 index 0000000000..71f3958f63 --- /dev/null +++ b/reference/mongo/mongo/close.xml @@ -0,0 +1,48 @@ + + + + + + Mongo::close + Closes this database connection + + + + &reftitle.description; + + public booleanMongo::close + + + + + + &reftitle.parameters; + &no.function.parameters; + + + + &reftitle.returnvalues; + + Returns if the connection was successfully closed. + + + + diff --git a/reference/mongo/mongo/connect.xml b/reference/mongo/mongo/connect.xml new file mode 100644 index 0000000000..4ebcd5cecd --- /dev/null +++ b/reference/mongo/mongo/connect.xml @@ -0,0 +1,56 @@ + + + + + + Mongo::connect + Connects to a database server + + + + &reftitle.description; + + public booleanMongo::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/functions/mongo-gridfs-store.xml b/reference/mongo/mongo/connectutil.xml similarity index 52% rename from reference/mongo/functions/mongo-gridfs-store.xml rename to reference/mongo/mongo/connectutil.xml index 4757b0c0d6..f2ba55df34 100644 --- a/reference/mongo/functions/mongo-gridfs-store.xml +++ b/reference/mongo/mongo/connectutil.xml @@ -1,22 +1,19 @@ - - + + - mongo_gridfs_store - Store a file in the database + Mongo::connectUtil + Connects with a database server &reftitle.description; - MongoIdmongo_gridfs_store - resourcegridfs - stringfilename + protected booleanMongo::connectUtil + stringusername + stringpassword - - Store a file in the database. - @@ -24,18 +21,22 @@ - gridfs + + username + - The gridfs connection to use. + A username used to identify the connection. - filename + + password + - Name of the file to store. + A password used to identify the connection. @@ -46,23 +47,18 @@ &reftitle.returnvalues; - The MongoId given to the file saved to the database. + If the connection was successful. - - &reftitle.seealso; + + &reftitle.errors; - - mongo_gridfs_init - mongo_gridfs_find - mongo_gridfs_list - + Throws MongoConnectionException if it fails to connect to the databases. - +--> diff --git a/reference/mongo/mongo/construct.xml b/reference/mongo/mongo/construct.xml new file mode 100644 index 0000000000..7f454f28e0 --- /dev/null +++ b/reference/mongo/mongo/construct.xml @@ -0,0 +1,102 @@ + + + + + + Mongo::__construct + Creates a new database connection object + + + + &reftitle.description; + + Mongo::__construct + stringserver&null; + booleanconnect&true; + booleanpersistent&false; + booleanpaired&false; + + + + + &reftitle.parameters; + + + + + server + + + + The server name. + + + + + + connect + + + + If the driver should connect to the database before returning. + + + + + + persistent + + + + If the connection should be persistent. + + + + + + paired + + + + If the connection should be paired. + + + + + + + + + &reftitle.returnvalues; + + Returns a new database connection object. + + + + + &reftitle.errors; + + Throws MongoConnectionException if it tries and fails to connect to the database. + + + + + diff --git a/reference/mongo/mongo/dropdb.xml b/reference/mongo/mongo/dropdb.xml new file mode 100644 index 0000000000..014fc4f979 --- /dev/null +++ b/reference/mongo/mongo/dropdb.xml @@ -0,0 +1,61 @@ + + + + + + Mongo::dropDB + Drops a database + + + + &reftitle.description; + + public arrayMongo::dropDB + mixeddb + + + + + &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/mongo/forceerror.xml b/reference/mongo/mongo/forceerror.xml new file mode 100644 index 0000000000..038bd20bb9 --- /dev/null +++ b/reference/mongo/mongo/forceerror.xml @@ -0,0 +1,48 @@ + + + + + + Mongo::forceError + Creates a database error + + + + &reftitle.description; + + public boolMongo::forceError + + + + + + &reftitle.parameters; + &no.function.parameters; + + + + &reftitle.returnvalues; + + Returns the database response. + + + + diff --git a/reference/mongo/mongo/lasterror.xml b/reference/mongo/mongo/lasterror.xml new file mode 100644 index 0000000000..2b5568eb52 --- /dev/null +++ b/reference/mongo/mongo/lasterror.xml @@ -0,0 +1,48 @@ + + + + + + Mongo::lastError + Check if there was an error on the most recent db operation performed + + + + &reftitle.description; + + public stringMongo::lastError + + + + + + &reftitle.parameters; + &no.function.parameters; + + + + &reftitle.returnvalues; + + Returns the error, if there was one, or &null;. + + + + diff --git a/reference/mongo/mongo/pairconnect.xml b/reference/mongo/mongo/pairconnect.xml new file mode 100644 index 0000000000..9192c44ec1 --- /dev/null +++ b/reference/mongo/mongo/pairconnect.xml @@ -0,0 +1,60 @@ + + + + + + Mongo::pairConnect + Connects to paired database server + + + + &reftitle.description; + + public booleanMongo::pairConnect + + + + To successfully create a paired connection, $this->server must be a string + of the form "server1,server2". + + + + + &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/pairpersistconnect.xml b/reference/mongo/mongo/pairpersistconnect.xml new file mode 100644 index 0000000000..cf3277836a --- /dev/null +++ b/reference/mongo/mongo/pairpersistconnect.xml @@ -0,0 +1,80 @@ + + + + + + Mongo::pairPersistConnect + Creates a persistent connection with paired database servers + + + + &reftitle.description; + + public booleanMongo::pairPersistConnect + stringusername"" + stringpassword"" + + + + + &reftitle.parameters; + + + + + username + + + + A username used to identify the connection. + + + + + + password + + + + A password used to identify the connection. + + + + + + + + + &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/persistconnect.xml b/reference/mongo/mongo/persistconnect.xml new file mode 100644 index 0000000000..7882225289 --- /dev/null +++ b/reference/mongo/mongo/persistconnect.xml @@ -0,0 +1,80 @@ + + + + + + Mongo::persistConnect + Creates a persistent connection with a database server + + + + &reftitle.description; + + public booleanMongo::persistConnect + stringusername"" + stringpassword"" + + + + + &reftitle.parameters; + + + + + username + + + + A username used to identify the connection. + + + + + + password + + + + A password used to identify the connection. + + + + + + + + + &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/preverror.xml b/reference/mongo/mongo/preverror.xml new file mode 100644 index 0000000000..9dcc16fa5d --- /dev/null +++ b/reference/mongo/mongo/preverror.xml @@ -0,0 +1,48 @@ + + + + + + Mongo::prevError + Checks for the last error thrown during a database operation + + + + &reftitle.description; + + public arrayMongo::prevError + + + + + + &reftitle.parameters; + &no.function.parameters; + + + + &reftitle.returnvalues; + + Returns the error and the number of operations ago it occured. + + + + diff --git a/reference/mongo/mongo/repairdb.xml b/reference/mongo/mongo/repairdb.xml new file mode 100644 index 0000000000..be45036d6f --- /dev/null +++ b/reference/mongo/mongo/repairdb.xml @@ -0,0 +1,83 @@ + + + + + + Mongo::repairDB + Repairs and compacts a database + + + + &reftitle.description; + + public arrayMongo::repairDB + MongoDBdb + booleanpreserve_cloned_filesfalse + booleanbackup_original_filesfalse + + + + + &reftitle.parameters; + + + + + db + + + + The database to drop. + + + + + + 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 the database response. + + + + diff --git a/reference/mongo/mongo/reseterror.xml b/reference/mongo/mongo/reseterror.xml new file mode 100644 index 0000000000..6807483c34 --- /dev/null +++ b/reference/mongo/mongo/reseterror.xml @@ -0,0 +1,48 @@ + + + + + + Mongo::resetError + Clears any flagged errors on the connection + + + + &reftitle.description; + + public arrayMongo::resetError + + + + + + &reftitle.parameters; + &no.function.parameters; + + + + &reftitle.returnvalues; + + Returns the database response. + + + + diff --git a/reference/mongo/mongo/selectcollection.xml b/reference/mongo/mongo/selectcollection.xml new file mode 100644 index 0000000000..b1e8ee3458 --- /dev/null +++ b/reference/mongo/mongo/selectcollection.xml @@ -0,0 +1,88 @@ + + + + + + Mongo::selectCollection + Gets a database collection + + + + &reftitle.description; + + public MongoCollectionMongo::selectCollection + string|MongoDBdb + stringcollection + + + + + &reftitle.parameters; + + + + + db + + + + The database name. + + + + + + collection + + + + The collection name. + + + + + + + + + &reftitle.returnvalues; + + Returns a new collection object. + + + + + &reftitle.errors; + + Throws InvalidArgumentException if the database or collection name is invalid. + + + + + &reftitle.examples; + + <function>Mongo::selectCollection</function> 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/mongo/selectdb.xml b/reference/mongo/mongo/selectdb.xml new file mode 100644 index 0000000000..b428a3aa1a --- /dev/null +++ b/reference/mongo/mongo/selectdb.xml @@ -0,0 +1,69 @@ + + + + + + Mongo::selectDB + Gets a database + + + + &reftitle.description; + + public MongoDBMongo::selectDB + stringdbname + + + + + &reftitle.parameters; + + + + + dbname + + + + The database name. + + + + + + + + + &reftitle.returnvalues; + + Returns a new db object. + + + + + &reftitle.errors; + + Throws InvalidArgumentException if the database name is invalid. + + + + + diff --git a/reference/mongo/mongo/tostring.xml b/reference/mongo/mongo/tostring.xml new file mode 100644 index 0000000000..a6d70eec84 --- /dev/null +++ b/reference/mongo/mongo/tostring.xml @@ -0,0 +1,48 @@ + + + + + + Mongo::__toString + String representation of this connection + + + + &reftitle.description; + + public stringMongo::__toString + + + + + + &reftitle.parameters; + &no.function.parameters; + + + + &reftitle.returnvalues; + + Returns hostname and port for this connection. + + + + diff --git a/reference/mongo/mongobindata/construct.xml b/reference/mongo/mongobindata/construct.xml index d55b9de206..5dfe5556a9 100644 --- a/reference/mongo/mongobindata/construct.xml +++ b/reference/mongo/mongobindata/construct.xml @@ -1,5 +1,5 @@ - + @@ -10,7 +10,7 @@ &reftitle.description; - MongoBinData::__construct + public MongoBinData::__construct stringdata inttype diff --git a/reference/mongo/mongocollection.xml b/reference/mongo/mongocollection.xml new file mode 100644 index 0000000000..f1dcfd0b58 --- /dev/null +++ b/reference/mongo/mongocollection.xml @@ -0,0 +1,72 @@ + + + + + + The MongoCollection class + MongoCollection + + + + +
+ &reftitle.intro; + + Representations a database collection. + + + Collection names cannot have a "$" in them, but other than that + they can use any character in the ASCII set. Some valid collection + names are "", "...", "my collection", and "*&#@". + +
+ + +
+ &reftitle.classsynopsis; + + + + MongoCollection + + + + + MongoCollection + + + + + Methods + + + + +
+ +
+ + &reference.mongo.entities.mongocollection; + +
+ + diff --git a/reference/mongo/mongocollection/batchinsert.xml b/reference/mongo/mongocollection/batchinsert.xml new file mode 100644 index 0000000000..73ba563b26 --- /dev/null +++ b/reference/mongo/mongocollection/batchinsert.xml @@ -0,0 +1,100 @@ + + + + + + MongoCollection::batchInsert + Inserts an array of arrays into the collection + + + + &reftitle.description; + + public booleanMongoCollection::batchInsert + arraya + + + + + &reftitle.parameters; + + + + + a + + + + An array of arrays. + + + + + + + + + &reftitle.returnvalues; + + Returns if the arrays were saved. + + + + + &reftitle.examples; + + <function>MongoCollection::batchInsert</function> example + + Batch insertion is a quick way to add many elements to the database at once + + + i); +} + +$m = new Mongo(); +$c = $m->selectCollection("foo", "bar.baz"); +$c->batchInsert($batch); + +$cursor = $c->find()->sort(array("i" => 1)); +while ($cursor->hasNext()) { + $obj = $cursor->next(); + var_dump($obj["i"]); +} +?> +]]> + + &example.outputs.similar; + + + + + + + diff --git a/reference/mongo/mongocollection/construct.xml b/reference/mongo/mongocollection/construct.xml new file mode 100644 index 0000000000..89804338a8 --- /dev/null +++ b/reference/mongo/mongocollection/construct.xml @@ -0,0 +1,83 @@ + + + + + + MongoCollection::__construct + Creates a new collection + + + + + &reftitle.description; + + public MongoCollection::__construct + MongoDBdb + stringname + + + + + &reftitle.parameters; + + + + + MongoDB + db + + + + Database. + + + + + + + + name + + + + Collection name. + + + + + + + + + &reftitle.returnvalues; + + Returns a new collection object. + + + + + &reftitle.errors; + + Throws InvalidArgumentException if the collection name is invalid. + + + + diff --git a/reference/mongo/mongocollection/count.xml b/reference/mongo/mongocollection/count.xml new file mode 100644 index 0000000000..0648cee45b --- /dev/null +++ b/reference/mongo/mongocollection/count.xml @@ -0,0 +1,48 @@ + + + + + + MongoCollection::count + Counts the number of documents in this collection + + + + &reftitle.description; + + public intMongoCollection::count + + + + + + &reftitle.parameters; + &no.function.parameters; + + + + &reftitle.returnvalues; + + Returns the number of documents. + + + + diff --git a/reference/mongo/mongocollection/createdbref.xml b/reference/mongo/mongocollection/createdbref.xml new file mode 100644 index 0000000000..ba6e25d465 --- /dev/null +++ b/reference/mongo/mongocollection/createdbref.xml @@ -0,0 +1,61 @@ + + + + + + MongoCollection::createDBRef + Creates a database reference + + + + &reftitle.description; + + public arrayMongoCollection::createDBRef + arraya + + + + + &reftitle.parameters; + + + + + a + + + + Object to which to create a reference. + + + + + + + + + &reftitle.returnvalues; + + Returns a database reference array. + + + + diff --git a/reference/mongo/mongocollection/deleteindex.xml b/reference/mongo/mongocollection/deleteindex.xml new file mode 100644 index 0000000000..d1de29405b --- /dev/null +++ b/reference/mongo/mongocollection/deleteindex.xml @@ -0,0 +1,92 @@ + + + + + + MongoCollection::deleteIndex + Deletes an index from this collection + + + + &reftitle.description; + + public arrayMongoCollection::deleteIndex + string|arraykeys + + + + + &reftitle.parameters; + + + + + keys + + + + Field or fields from which to delete the index. + + + + + + + + + &reftitle.returnvalues; + + Returns the database response. + + + + + &reftitle.examples; + + <function>MongoCollection::deleteIndex</function> example + + This example passes the function string and array parameters. + + +selectCollection("example", "indices"); + +// create an index +$c->ensureIndex(array("i"=>1)); + +// remove a simple index +$c->deleteIndex("i"); + + +// create a multi-key index +$c->ensureIndex(array("j" => 1, "k" => 1)); + +// remove a multi-key index +$c->deleteIndex(array("j" => 1, "k" => 1)); +?> +]]> + + + + + diff --git a/reference/mongo/mongocollection/deleteindexes.xml b/reference/mongo/mongocollection/deleteindexes.xml new file mode 100644 index 0000000000..dc5547702f --- /dev/null +++ b/reference/mongo/mongocollection/deleteindexes.xml @@ -0,0 +1,49 @@ + + + + + + MongoCollection::deleteIndexes + Delete all indices for this collection + + + + &reftitle.description; + + public arrayMongoCollection::deleteIndexes + + + + + + &reftitle.parameters; + &no.function.parameters; + + + + &reftitle.returnvalues; + + Returns the database response. + + + + + diff --git a/reference/mongo/mongocollection/drop.xml b/reference/mongo/mongocollection/drop.xml new file mode 100644 index 0000000000..b70394d0f6 --- /dev/null +++ b/reference/mongo/mongocollection/drop.xml @@ -0,0 +1,51 @@ + + + + + + MongoCollection::drop + Drops this collection + + + + &reftitle.description; + + public arrayMongoCollection::drop + + + + Drops this collection and deletes its indices. + + + + + &reftitle.parameters; + &no.function.parameters; + + + + &reftitle.returnvalues; + + Returns the database response. + + + + diff --git a/reference/mongo/mongocollection/ensureindex.xml b/reference/mongo/mongocollection/ensureindex.xml new file mode 100644 index 0000000000..1256088e0c --- /dev/null +++ b/reference/mongo/mongocollection/ensureindex.xml @@ -0,0 +1,93 @@ + + + + + + MongoCollection::ensureIndex + + Creates an index on the given field(s), or does nothing if the index + already exists + + + + + &reftitle.description; + + public booleanMongoCollection::ensureIndex + string|arraykeys + + + + + &reftitle.parameters; + + + + + keys + + + + Field or fields to use as index. + + + + + + + + + &reftitle.returnvalues; + + Returns &true;. + + + + + &reftitle.examples; + + <function>MongoCollection::ensureIndex</function> example + +ensureIndex('x'); + +// create an index on 'y' ascending +$c->ensureIndex(array('y' => 1)); + +// create an index on 'w' descending +$c->ensureIndex(array('w' => -1)); + +// create an index on 'z' ascending and 'zz' descending +$c->ensureIndex(array('z' => 1, 'zz' => -1)); + +?> +]]> + + + + + + diff --git a/reference/mongo/mongocollection/find.xml b/reference/mongo/mongocollection/find.xml new file mode 100644 index 0000000000..181ff1f698 --- /dev/null +++ b/reference/mongo/mongocollection/find.xml @@ -0,0 +1,71 @@ + + + + + + MongoCollection::find + Querys this collection + + + + &reftitle.description; + + public MongoCursorMongoCollection::find + arrayqueryarray() + arrayfieldsarray() + + + + + &reftitle.parameters; + + + + + query + + + + The fields for which to search. + + + + + + fields + + + + Fields of the results to return. + + + + + + + + &reftitle.returnvalues; + + Returns a cursor for the search results. + + + + diff --git a/reference/mongo/mongocollection/findone.xml b/reference/mongo/mongocollection/findone.xml new file mode 100644 index 0000000000..a44f4ce843 --- /dev/null +++ b/reference/mongo/mongocollection/findone.xml @@ -0,0 +1,60 @@ + + + + + + MongoCollection::findOne + Querys this collection, returning a single element + + + + &reftitle.description; + + public arrayMongoCollection::findOne + arrayqueryarray() + + + + + &reftitle.parameters; + + + + + query + + + + The fields for which to search. + + + + + + + + &reftitle.returnvalues; + + Returns record matching the search or &null;. + + + + diff --git a/reference/mongo/mongocollection/getdbref.xml b/reference/mongo/mongocollection/getdbref.xml new file mode 100644 index 0000000000..783302799d --- /dev/null +++ b/reference/mongo/mongocollection/getdbref.xml @@ -0,0 +1,61 @@ + + + + + + MongoCollection::getDBRef + Fetches a database reference + + + + &reftitle.description; + + public arrayMongoCollection::getDBRef + arrayref + + + + + &reftitle.parameters; + + + + + ref + + + + A database reference. + + + + + + + + + &reftitle.returnvalues; + + Returns the database document pointed to by the reference. + + + + diff --git a/reference/mongo/mongocollection/getindexinfo.xml b/reference/mongo/mongocollection/getindexinfo.xml new file mode 100644 index 0000000000..05a33545a9 --- /dev/null +++ b/reference/mongo/mongocollection/getindexinfo.xml @@ -0,0 +1,48 @@ + + + + + + MongoCollection::getIndexInfo + Returns an array of index names for this collection + + + + &reftitle.description; + + public arrayMongoCollection::getIndexInfo + + + + + + &reftitle.parameters; + &no.function.parameters; + + + + &reftitle.returnvalues; + + Returns a list of index names. + + + + diff --git a/reference/mongo/mongocollection/getname.xml b/reference/mongo/mongocollection/getname.xml new file mode 100644 index 0000000000..c2c414f40f --- /dev/null +++ b/reference/mongo/mongocollection/getname.xml @@ -0,0 +1,73 @@ + + + + + + MongoCollection::getName + Returns this collection's name + + + &reftitle.description; + + public stringMongoCollection::getName + + + + + + &reftitle.parameters; + &no.function.parameters; + + + + &reftitle.returnvalues; + + Returns the name of this collection. + + + + &reftitle.examples; + + + <function>MongoCollection::getName</function> example + +selectDB("foo")->selectCollection("bar.baz"); + +echo "Working with collection " . $c->getName() . "."; + +?> +]]> + + &example.outputs.similar; + + + + + + + + diff --git a/reference/mongo/mongocollection/insert.xml b/reference/mongo/mongocollection/insert.xml new file mode 100644 index 0000000000..3c08f8f47b --- /dev/null +++ b/reference/mongo/mongocollection/insert.xml @@ -0,0 +1,61 @@ + + + + + + MongoCollection::insert + Inserts an array into the collection + + + + &reftitle.description; + + public booleanMongoCollection::insert + arraya + + + + + &reftitle.parameters; + + + + + a + + + + An array. + + + + + + + + + &reftitle.returnvalues; + + Returns if the array was inserted. + + + + diff --git a/reference/mongo/mongocollection/remove.xml b/reference/mongo/mongocollection/remove.xml new file mode 100644 index 0000000000..0df47ae331 --- /dev/null +++ b/reference/mongo/mongocollection/remove.xml @@ -0,0 +1,71 @@ + + + + + + MongoCollection::remove + Remove records from this collection + + + + &reftitle.description; + + public booleanMongoCollection::remove + arraycriteria + booleanjustOne&false; + + + + + &reftitle.parameters; + + + + + criteria + + + + Description of records to remove. + + + + + + just_one + + + + Remove at most one record matching this criteria. + + + + + + + + &reftitle.returnvalues; + + Returns if the command was executed successfully. + + + + diff --git a/reference/mongo/functions/mongo-close.xml b/reference/mongo/mongocollection/save.xml similarity index 56% rename from reference/mongo/functions/mongo-close.xml rename to reference/mongo/mongocollection/save.xml index 70774ee25a..91a59df8be 100644 --- a/reference/mongo/functions/mongo-close.xml +++ b/reference/mongo/mongocollection/save.xml @@ -1,35 +1,38 @@ - - + + - mongo_close - Closes a connection to the database + MongoCollection::save + Saves an object to this collection &reftitle.description; - boolmongo_close - resourceconnection + public booleanMongoCollection::save + arraya - Close a connection to the database and frees the connection object. + If the object is from the database, update the existing database object, otherwise + insert this object. - &reftitle.parameters; + &reftitle.parameters; - connection + + a + - The database connection to close. + Array to save. - + @@ -37,22 +40,10 @@ &reftitle.returnvalues; - &return.success; + Returns if the object was saved. - - - - &reftitle.seealso; - - - mongo_connect - - - - - +--> diff --git a/reference/mongo/mongocollection/tostring.xml b/reference/mongo/mongocollection/tostring.xml new file mode 100644 index 0000000000..1b190fe2fd --- /dev/null +++ b/reference/mongo/mongocollection/tostring.xml @@ -0,0 +1,73 @@ + + + + + + MongoCollection::__toString + String representation of this collection + + + &reftitle.description; + + public stringMongoCollection::__toString + + + + + + &reftitle.parameters; + &no.function.parameters; + + + + &reftitle.returnvalues; + + Returns the full name of this collection. + + + + &reftitle.examples; + + + <function>MongoCollection::__toString</function> example + +selectDB("foo")->selectCollection("bar.baz"); + +echo "Working with collection $c."; + +?> +]]> + + &example.outputs.similar; + + + + + + + + diff --git a/reference/mongo/mongocollection/update.xml b/reference/mongo/mongocollection/update.xml new file mode 100644 index 0000000000..c1ed67fd40 --- /dev/null +++ b/reference/mongo/mongocollection/update.xml @@ -0,0 +1,82 @@ + + + + + + MongoCollection::update + Update records based on a given criteria + + + + &reftitle.description; + + public booleanMongoCollection::update + arraycriteria + arraynewobj + booleanupsert&false; + + + + + &reftitle.parameters; + + + + + criteria + + + + Description of the objects to update. + + + + + + newobj + + + + The object with which to update the matching records. + + + + + + upsert + + + + If $newobj should be inserted if the criteria is not found. + + + + + + + + &reftitle.returnvalues; + + Returns if the update was successful. + + + + diff --git a/reference/mongo/mongocollection/validate.xml b/reference/mongo/mongocollection/validate.xml new file mode 100644 index 0000000000..38d73f8fd9 --- /dev/null +++ b/reference/mongo/mongocollection/validate.xml @@ -0,0 +1,61 @@ + + + + + + MongoCollection::validate + Validates this collection + + + + &reftitle.description; + + public arrayMongoCollection::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/mongocursor.xml b/reference/mongo/mongocursor.xml new file mode 100644 index 0000000000..4ec6354f93 --- /dev/null +++ b/reference/mongo/mongocursor.xml @@ -0,0 +1,86 @@ + + + + + + The MongoCursor class + MongoCursor + + + + +
+ &reftitle.intro; + + Result object for database query. + + + The database is not actually queried until next() or hasNext() is called. + Before the database is queried, commands can be strung together, as in: +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 + + + + + implements + Iterator + + + + + Methods + + + + +
+ +
+ + &reference.mongo.entities.mongocursor; + +
+ + diff --git a/reference/mongo/mongocursor/construct.xml b/reference/mongo/mongocursor/construct.xml new file mode 100644 index 0000000000..4d4145f818 --- /dev/null +++ b/reference/mongo/mongocursor/construct.xml @@ -0,0 +1,95 @@ + + + + + + MongoCursor::__construct + Create a new cursor + + + + &reftitle.description; + + MongoCursor::__construct + resourceconnection + 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/current.xml b/reference/mongo/mongocursor/current.xml new file mode 100644 index 0000000000..6fca9c5158 --- /dev/null +++ b/reference/mongo/mongocursor/current.xml @@ -0,0 +1,48 @@ + + + + + + MongoCursor::current + Returns the current result + + + + &reftitle.description; + + public arrayMongoCursor::current + + + + + + &reftitle.parameters; + &no.function.parameters; + + + + &reftitle.returnvalues; + + The current result. + + + + diff --git a/reference/mongo/mongocursor/doquery.xml b/reference/mongo/mongocursor/doquery.xml new file mode 100644 index 0000000000..d1acb6f576 --- /dev/null +++ b/reference/mongo/mongocursor/doquery.xml @@ -0,0 +1,48 @@ + + + + + + MongoCursor::doQuery + Execute the query. + + + + &reftitle.description; + + protected voidMongoCursor::doQuery + + + + + + &reftitle.parameters; + &no.function.parameters; + + + + &reftitle.returnvalues; + + &null;. + + + + diff --git a/reference/mongo/mongocursor/getnext.xml b/reference/mongo/mongocursor/getnext.xml new file mode 100644 index 0000000000..3dba397568 --- /dev/null +++ b/reference/mongo/mongocursor/getnext.xml @@ -0,0 +1,48 @@ + + + + + + MongoCursor::getNext + Return the next object to which this cursor points, and advance the cursor + + + + &reftitle.description; + + public arrayMongoCursor::getNext + + + + + + &reftitle.parameters; + &no.function.parameters; + + + + &reftitle.returnvalues; + + Returns the next object. + + + + diff --git a/reference/mongo/mongocursor/hasnext.xml b/reference/mongo/mongocursor/hasnext.xml new file mode 100644 index 0000000000..7c343274eb --- /dev/null +++ b/reference/mongo/mongocursor/hasnext.xml @@ -0,0 +1,48 @@ + + + + + + MongoCursor::hasNext + Checks if there are any more elements in this cursor + + + + &reftitle.description; + + public booleanMongoCursor::hasNext + + + + + + &reftitle.parameters; + &no.function.parameters; + + + + &reftitle.returnvalues; + + Returns if there is another element. + + + + diff --git a/reference/mongo/mongocursor/hint.xml b/reference/mongo/mongocursor/hint.xml new file mode 100644 index 0000000000..e35e4c65e5 --- /dev/null +++ b/reference/mongo/mongocursor/hint.xml @@ -0,0 +1,68 @@ + + + + + + MongoCursor::hint + Gives the database a hint about the query + + + + &reftitle.description; + + public MongoCursorMongoCursor::hint + arraykey_pattern + + + + + &reftitle.parameters; + + + + + key_pattern + + + + Indexes to use for the query. + + + + + + + + + &reftitle.returnvalues; + + Returns this cursor. + + + + + &reftitle.errors; + + Throws MongoCursorException if this cursor has started iterating. + + + + diff --git a/reference/mongo/mongocursor/limit.xml b/reference/mongo/mongocursor/limit.xml new file mode 100644 index 0000000000..3baf1c940c --- /dev/null +++ b/reference/mongo/mongocursor/limit.xml @@ -0,0 +1,69 @@ + + + + + + MongoCursor::limit + Limits the number of results returned + + + + &reftitle.description; + + public MongoCursorMongoCursor::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. + + + + + diff --git a/reference/mongo/mongocursor/next.xml b/reference/mongo/mongocursor/next.xml new file mode 100644 index 0000000000..9d81a858ea --- /dev/null +++ b/reference/mongo/mongocursor/next.xml @@ -0,0 +1,48 @@ + + + + + + MongoCursor::next + Advances the cursor to the next result + + + + &reftitle.description; + + public voidMongoCursor::next + + + + + + &reftitle.parameters; + &no.function.parameters; + + + + &reftitle.returnvalues; + + &null;. + + + + diff --git a/reference/mongo/mongocursor/reset.xml b/reference/mongo/mongocursor/reset.xml new file mode 100644 index 0000000000..e12efb6be5 --- /dev/null +++ b/reference/mongo/mongocursor/reset.xml @@ -0,0 +1,48 @@ + + + + + + MongoCursor::reset + Clears the cursor + + + + &reftitle.description; + + public voidMongoCursor::reset + + + + + + &reftitle.parameters; + &no.function.parameters; + + + + &reftitle.returnvalues; + + &null;. + + + + diff --git a/reference/mongo/mongocursor/rewind.xml b/reference/mongo/mongocursor/rewind.xml new file mode 100644 index 0000000000..0229597b34 --- /dev/null +++ b/reference/mongo/mongocursor/rewind.xml @@ -0,0 +1,48 @@ + + + + + + MongoCursor::rewind + Returns the cursor to the beginning of the result set + + + + &reftitle.description; + + public voidMongoCursor::rewind + + + + + + &reftitle.parameters; + &no.function.parameters; + + + + &reftitle.returnvalues; + + &null;. + + + + diff --git a/reference/mongo/mongocursor/skip.xml b/reference/mongo/mongocursor/skip.xml new file mode 100644 index 0000000000..34bb07a513 --- /dev/null +++ b/reference/mongo/mongocursor/skip.xml @@ -0,0 +1,69 @@ + + + + + + MongoCursor::skip + Skips a number of results + + + + &reftitle.description; + + public MongoCursorMongoCursor::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. + + + + + diff --git a/reference/mongo/mongocursor/softlimit.xml b/reference/mongo/mongocursor/softlimit.xml new file mode 100644 index 0000000000..02df35f56f --- /dev/null +++ b/reference/mongo/mongocursor/softlimit.xml @@ -0,0 +1,89 @@ + + + + + + MongoCursor::softLimit + Limits the number of results initially returned + + + + &reftitle.description; + + public MongoCursorMongoCursor::softLimit + 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.examples; + + <function>MongoCursor::softLimit</function> and <function>MongoCursor::limit</function> example + + limit() and softLimit() are mutually exclusive, and whichever one comes last will "win": + + +find()->softLimit(10)->limit(20); + +// all documents returned, 10 sent to the client on initial request +$cursor2 = $collection->find()->limit(20)->softLimit(10); +?> +]]> + + + + + diff --git a/reference/mongo/mongocursor/sort.xml b/reference/mongo/mongocursor/sort.xml new file mode 100644 index 0000000000..ae9e321c98 --- /dev/null +++ b/reference/mongo/mongocursor/sort.xml @@ -0,0 +1,93 @@ + + + + + + MongoCursor::sort + Sorts the results by given fields + + + + &reftitle.description; + + public MongoCursorMongoCursor::sort + arrayfields + + + + + &reftitle.parameters; + + + + + fields + + + + The fields by which to sort. + + + + + + + + + &reftitle.returnvalues; + + Returns this cursor. + + + + + &reftitle.errors; + + Throws MongoCursorException if this cursor has started iterating. + + + + + &reftitle.examples; + + <function>MongoCursor::sort</function> example + +sort(array('x' => 1)); + +// the associative array is ordered, for instance, these two +// examples might yield different results: + +// sort date ascending and age descending +$cursor->sort(array('date' => 1, 'age' => -1)); + +// sort age descending and date ascending +$cursor->sort(array('age' => -1, 'date' => 1)); +?> +]]> + + + + + + diff --git a/reference/mongo/mongocursor/valid.xml b/reference/mongo/mongocursor/valid.xml new file mode 100644 index 0000000000..28d60a0461 --- /dev/null +++ b/reference/mongo/mongocursor/valid.xml @@ -0,0 +1,48 @@ + + + + + + MongoCursor::valid + Checks if the cursor is reading a valid result. + + + + &reftitle.description; + + public booleanMongoCursor::valid + + + + + + &reftitle.parameters; + &no.function.parameters; + + + + &reftitle.returnvalues; + + If the current result is not null. + + + + diff --git a/reference/mongo/mongodb.xml b/reference/mongo/mongodb.xml new file mode 100644 index 0000000000..e4f431760b --- /dev/null +++ b/reference/mongo/mongodb.xml @@ -0,0 +1,83 @@ + + + + + + The MongoDB class + MongoDB + + + + +
+ &reftitle.intro; + + Instances of this class are used to interact with a database. To get a + database: +selectDB("example"); +?> +]]> + + Database names can use almost any character in the ASCII range. However, + they cannot contain " ", "." or be the empty string. + + + A few unusual, but valid, database names: "null", "[x,y]", "3", "\"", "/". + + + Unlike collection names, database names may contain "$". + +
+ + +
+ &reftitle.classsynopsis; + + + + MongoDB + + + + + MongoDB + + + + + Methods + + + + +
+ +
+ + &reference.mongo.entities.mongodb; + +
+ + diff --git a/reference/mongo/mongodb/construct.xml b/reference/mongo/mongodb/construct.xml new file mode 100644 index 0000000000..6b321b5c58 --- /dev/null +++ b/reference/mongo/mongodb/construct.xml @@ -0,0 +1,81 @@ + + + + + + MongoDB::__construct + Creates a new database + + + + &reftitle.description; + + MongoDB::__construct + Mongoconn + stringname + + + + + &reftitle.parameters; + + + + + Mongo + conn + + + + Database connection. + + + + + + name + + + + Database name. + + + + + + + + + &reftitle.returnvalues; + + Returns the database. + + + + + &reftitle.errors; + + Throws InvalidArgumentException if the database name is invalid. + + + + + diff --git a/reference/mongo/mongodb/createcollection.xml b/reference/mongo/mongodb/createcollection.xml new file mode 100644 index 0000000000..67d127e1ab --- /dev/null +++ b/reference/mongo/mongodb/createcollection.xml @@ -0,0 +1,91 @@ + + + + + + MongoDB::createCollection + Creates a collection + + + &reftitle.description; + + public MongoCollectionMongoDB::createCollection + stringname + boolcapped&false; + intsize0 + intmax0 + + + + &reftitle.parameters; + + + + + name + + + + The name of the collection. + + + + + + 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. + + + + + + + + &reftitle.returnvalues; + + Returns a collection object representing the new collection. + + + + diff --git a/reference/mongo/mongodb/createdbref.xml b/reference/mongo/mongodb/createdbref.xml new file mode 100644 index 0000000000..93eb4c08a8 --- /dev/null +++ b/reference/mongo/mongodb/createdbref.xml @@ -0,0 +1,72 @@ + + + + + + MongoDB::createDBRef + Creates a database reference + + + + &reftitle.description; + + public arrayMongoDB::createDBRef + mixedns + mixeda + + + + + &reftitle.parameters; + + + + + ns + + + + The collection to which the database reference will point. + + + + + + a + + + + Object or _id to which to create a reference. + + + + + + + + + &reftitle.returnvalues; + + Returns a database reference array. + + + + diff --git a/reference/mongo/mongodb/drop.xml b/reference/mongo/mongodb/drop.xml new file mode 100644 index 0000000000..c9046a102e --- /dev/null +++ b/reference/mongo/mongodb/drop.xml @@ -0,0 +1,48 @@ + + + + + + MongoDB::drop + Drops this database + + + + &reftitle.description; + + public arrayMongoDB::drop + + + + + + &reftitle.parameters; + &no.function.parameters; + + + + &reftitle.returnvalues; + + Returns the database response. + + + + diff --git a/reference/mongo/mongodb/dropcollection.xml b/reference/mongo/mongodb/dropcollection.xml new file mode 100644 index 0000000000..79710ec7e1 --- /dev/null +++ b/reference/mongo/mongodb/dropcollection.xml @@ -0,0 +1,58 @@ + + + + + + MongoDB::dropCollection + Drops a collection + + + &reftitle.description; + + public arrayMongoDB::dropCollection + mixedcoll + + + + &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 new file mode 100644 index 0000000000..b4b0c2abe4 --- /dev/null +++ b/reference/mongo/mongodb/execute.xml @@ -0,0 +1,72 @@ + + + + + + MongoDB::execute + Runs JavaScript code on the database server. + + + + &reftitle.description; + + public arrayMongoDB::execute + mixedcode + arrayargsarray() + + + + + &reftitle.parameters; + + + + + code + + + + MongoCode or string to execute. + + + + + + args + + + + Arguments to be passed to code. + + + + + + + + + &reftitle.returnvalues; + + Returns the result of the evaluation. + + + + diff --git a/reference/mongo/mongodb/getcursorinfo.xml b/reference/mongo/mongodb/getcursorinfo.xml new file mode 100644 index 0000000000..b86d6a76fa --- /dev/null +++ b/reference/mongo/mongodb/getcursorinfo.xml @@ -0,0 +1,45 @@ + + + + + + MongoDB::getCursorInfo + Gets information from the database about cursors + + + &reftitle.description; + + public arrayMongoDB::getCursorInfo + + + + + &reftitle.parameters; + &no.function.parameters; + + + &reftitle.returnvalues; + + Returns the database response. + + + + diff --git a/reference/mongo/mongodb/getdbref.xml b/reference/mongo/mongodb/getdbref.xml new file mode 100644 index 0000000000..13090ab665 --- /dev/null +++ b/reference/mongo/mongodb/getdbref.xml @@ -0,0 +1,61 @@ + + + + + + MongoDB::getDBRef + Fetches a database reference + + + + &reftitle.description; + + public arrayMongoDB::getDBRef + arrayref + + + + + &reftitle.parameters; + + + + + ref + + + + A database reference. + + + + + + + + + &reftitle.returnvalues; + + Returns the database document pointed to by the reference. + + + + diff --git a/reference/mongo/mongodb/getgridfs.xml b/reference/mongo/mongodb/getgridfs.xml new file mode 100644 index 0000000000..f05935244e --- /dev/null +++ b/reference/mongo/mongodb/getgridfs.xml @@ -0,0 +1,73 @@ + + + + + + MongoDB::getGridFS + Fetches toolkit for dealing with files stored in this database + + + + &reftitle.description; + + public MongoGridFSMongoDB::getGridFS + stringarg1"fs" + stringarg2&null; + + + + + &reftitle.parameters; + + + + + arg1 + + + + If the only argument, the prefix for the files and chunks collections. Otherwise, + the name of the files collection. + + + + + + arg2 + + + + Name of the chunks collection. + + + + + + + + + &reftitle.returnvalues; + + Returns a new gridfs object for this database. + + + + diff --git a/reference/mongo/mongodb/getprofilinglevel.xml b/reference/mongo/mongodb/getprofilinglevel.xml new file mode 100644 index 0000000000..330841dbcc --- /dev/null +++ b/reference/mongo/mongodb/getprofilinglevel.xml @@ -0,0 +1,48 @@ + + + + + + MongoDB::getProfilingLevel + Gets this database's profiling level + + + + &reftitle.description; + + public intMongoDB::getProfilingLevel + + + + + + &reftitle.parameters; + &no.function.parameters; + + + + &reftitle.returnvalues; + + Returns the profiling level. + + + + diff --git a/reference/mongo/mongodb/listcollections.xml b/reference/mongo/mongodb/listcollections.xml new file mode 100644 index 0000000000..f81d0dce19 --- /dev/null +++ b/reference/mongo/mongodb/listcollections.xml @@ -0,0 +1,45 @@ + + + + + + MongoDB::listCollections + Get a list of collections in this database + + + &reftitle.description; + + public arrayMongoDB::listCollections + + + + + &reftitle.parameters; + &no.function.parameters; + + + &reftitle.returnvalues; + + Returns a list of collection names. + + + + diff --git a/reference/mongo/mongodb/repair.xml b/reference/mongo/mongodb/repair.xml new file mode 100644 index 0000000000..985c2c7741 --- /dev/null +++ b/reference/mongo/mongodb/repair.xml @@ -0,0 +1,72 @@ + + + + + + MongoDB::repair + Repairs and compacts this database + + + + &reftitle.description; + + public arrayMongoDB::repair + boolpreserve_cloned_files&false; + boolbackup_original_files&false; + + + + + &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. + + + + diff --git a/reference/mongo/mongodb/selectcollection.xml b/reference/mongo/mongodb/selectcollection.xml new file mode 100644 index 0000000000..fd9dc089c9 --- /dev/null +++ b/reference/mongo/mongodb/selectcollection.xml @@ -0,0 +1,58 @@ + + + + + + MongoDB::selectCollection + Gets a collection + + + &reftitle.description; + + public MongoCollectionMongoDB::selectCollection + stringname + + + + &reftitle.parameters; + + + + + name + + + + The name of the collection. + + + + + + + + &reftitle.returnvalues; + + Returns the collection. + + + + diff --git a/reference/mongo/mongodb/setprofilinglevel.xml b/reference/mongo/mongodb/setprofilinglevel.xml new file mode 100644 index 0000000000..db6c6c3ceb --- /dev/null +++ b/reference/mongo/mongodb/setprofilinglevel.xml @@ -0,0 +1,61 @@ + + + + + + MongoDB::setProfilingLevel + Sets this database's profiling level + + + + &reftitle.description; + + public intMongoDB::setProfilingLevel + intlevel + + + + + &reftitle.parameters; + + + + + level + + + + Profiling level. + + + + + + + + + &reftitle.returnvalues; + + Returns the previous profiling level. + + + + diff --git a/reference/mongo/mongodb/tostring.xml b/reference/mongo/mongodb/tostring.xml new file mode 100644 index 0000000000..75d7aa3342 --- /dev/null +++ b/reference/mongo/mongodb/tostring.xml @@ -0,0 +1,48 @@ + + + + + + MongoDB::__toString + The name of this database + + + + &reftitle.description; + + public stringMongoDB::__toString + + + + + + &reftitle.parameters; + &no.function.parameters; + + + + &reftitle.returnvalues; + + Returns this database's name. + + + + diff --git a/reference/mongo/mongogridfs.xml b/reference/mongo/mongogridfs.xml new file mode 100644 index 0000000000..b8ba2c10db --- /dev/null +++ b/reference/mongo/mongogridfs.xml @@ -0,0 +1,68 @@ + + + + + + The MongoGridFS class + MongoGridFS + + + + +
+ &reftitle.intro; + + Utilities for storing and retreiving files from the database. + +
+ + +
+ &reftitle.classsynopsis; + + + + MongoGridFS + + + + + extends + MongoCollection + + + + + Methods + + + + +
+ +
+ + &reference.mongo.entities.mongogridfs; + +
+ + diff --git a/reference/mongo/mongogridfs/construct.xml b/reference/mongo/mongogridfs/construct.xml new file mode 100644 index 0000000000..214f2b66a9 --- /dev/null +++ b/reference/mongo/mongogridfs/construct.xml @@ -0,0 +1,96 @@ + + + + + + MongoGridFS::__construct + Creates new file collections + + + &reftitle.description; + + MongoGridFS::__construct + MongoDBdb + stringfiles&null; + stringchunks&null; + + + + 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. + + + Use two arguments to fully specify the collection names: + + uses myfiles and mychunks collections. + + + + + &reftitle.parameters; + + + + + db + + + + Database. + + + + + + files + + + + Optional files collection name. If chunks is not given, + files is used as both collections' prefix. + + + + + + chunks + + + + Optional chunks collection name. + + + + + + + + diff --git a/reference/mongo/mongogridfs/drop.xml b/reference/mongo/mongogridfs/drop.xml new file mode 100644 index 0000000000..9313512928 --- /dev/null +++ b/reference/mongo/mongogridfs/drop.xml @@ -0,0 +1,49 @@ + + + + + + MongoGridFS::drop + Drops the files and chunks collections + + + + &reftitle.description; + + public arrayMongoGridFS::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 new file mode 100644 index 0000000000..dc7447f0d0 --- /dev/null +++ b/reference/mongo/mongogridfs/find.xml @@ -0,0 +1,73 @@ + + + + + + MongoGridFS::find + Queries for files + + + + &reftitle.description; + + public MongoGridFSCursorMongoGridFS::find + arrayqueryarray() + arrayfieldsarray() + + + + + &reftitle.parameters; + + + + + query + + + + The query. + + + + + + fields + + + + Fields to return. + + + + + + + + + &reftitle.returnvalues; + + A file cursor to the results. + + + + + diff --git a/reference/mongo/mongogridfs/findone.xml b/reference/mongo/mongogridfs/findone.xml new file mode 100644 index 0000000000..e953d40049 --- /dev/null +++ b/reference/mongo/mongogridfs/findone.xml @@ -0,0 +1,62 @@ + + + + + + MongoGridFS::findOne + Returns a single file matching the criteria + + + + &reftitle.description; + + public MongoGridFSFileMongoGridFS::findOne + mixedqueryarray() + + + + + &reftitle.parameters; + + + + + query + + + + The filename or criteria for which to search. + + + + + + + + + &reftitle.returnvalues; + + Returns a file or &null;. + + + + + diff --git a/reference/mongo/mongogridfs/remove.xml b/reference/mongo/mongogridfs/remove.xml new file mode 100644 index 0000000000..ee732ac931 --- /dev/null +++ b/reference/mongo/mongogridfs/remove.xml @@ -0,0 +1,73 @@ + + + + + + MongoGridFS::remove + Removes files from the collections + + + + &reftitle.description; + + public booleanMongoGridFS::remove + arraycriteriaarray() + booleanjust_one&false; + + + + + &reftitle.parameters; + + + + + query + + + + The filename or criteria for which to search. + + + + + + just_one + + + + If only one matching file should be removed. + + + + + + + + + &reftitle.returnvalues; + + Returns if the removal was successful. + + + + + diff --git a/reference/mongo/mongogridfs/storefile.xml b/reference/mongo/mongogridfs/storefile.xml new file mode 100644 index 0000000000..124569dcf6 --- /dev/null +++ b/reference/mongo/mongogridfs/storefile.xml @@ -0,0 +1,73 @@ + + + + + + MongoGridFS::storeFile + Stores a file in the database + + + + &reftitle.description; + + public MongoIdMongoGridFS::storeFile + stringfilename + arrayextraarray() + + + + + &reftitle.parameters; + + + + + filename + + + + The name of the file. + + + + + + extra + + + + Other metadata to add to the file saved. + + + + + + + + + &reftitle.returnvalues; + + Returns the database id for the file. + + + + + diff --git a/reference/mongo/mongogridfs/storeupload.xml b/reference/mongo/mongogridfs/storeupload.xml new file mode 100644 index 0000000000..795740c5cf --- /dev/null +++ b/reference/mongo/mongogridfs/storeupload.xml @@ -0,0 +1,72 @@ + + + + + + MongoGridFS::storeUpload + Saves an uploaded file to the database + + + + &reftitle.description; + + public MongoIdMongoGridFS::storeUpload + stringname + arrayextra + + + + + &reftitle.parameters; + + + + + name + + + + The name field of the uploaded file. + + + + + + extra + + + + Other metadata to add to the file saved. + + + + + + + + + &reftitle.returnvalues; + + Returns the id of the uploaded file. + + + + diff --git a/reference/mongo/mongogridfsfile.xml b/reference/mongo/mongogridfsfile.xml new file mode 100644 index 0000000000..6a1c6a9189 --- /dev/null +++ b/reference/mongo/mongogridfsfile.xml @@ -0,0 +1,67 @@ + + + + + + The MongoGridFSFile class + MongoGridFSFile + + + + +
+ &reftitle.intro; + + A database file object. + +
+ + +
+ &reftitle.classsynopsis; + + + + MongoGridFSFile + + + + + MongoGridFSFile + + + + + Methods + + + + +
+ +
+ + &reference.mongo.entities.mongogridfsfile; + +
+ + diff --git a/reference/mongo/mongogridfsfile/construct.xml b/reference/mongo/mongogridfsfile/construct.xml new file mode 100644 index 0000000000..3889a29d01 --- /dev/null +++ b/reference/mongo/mongogridfsfile/construct.xml @@ -0,0 +1,71 @@ + + + + + + MongoGridfsFile::__construct + Create a new GridFS file + + + &reftitle.description; + + MongoGridfsFile::__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 new file mode 100644 index 0000000000..41d4143118 --- /dev/null +++ b/reference/mongo/mongogridfsfile/getbytes.xml @@ -0,0 +1,52 @@ + + + + + + MongoGridFSFile::getBytes + Returns this file's contents as a string of bytes + + + + &reftitle.description; + + public stringMongoGridFSFile::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. + + + + diff --git a/reference/mongo/mongogridfsfile/getfilename.xml b/reference/mongo/mongogridfsfile/getfilename.xml new file mode 100644 index 0000000000..dbd9de4347 --- /dev/null +++ b/reference/mongo/mongogridfsfile/getfilename.xml @@ -0,0 +1,45 @@ + + + + + + MongoGridfsFile::getFilename + Returns this file's filename + + + &reftitle.description; + + public stringMongoGridfsFile::getFilename + + + + + &reftitle.parameters; + &no.function.parameters; + + + &reftitle.returnvalues; + + Returns the filename. + + + + diff --git a/reference/mongo/mongogridfsfile/getsize.xml b/reference/mongo/mongogridfsfile/getsize.xml new file mode 100644 index 0000000000..f80e34cfb6 --- /dev/null +++ b/reference/mongo/mongogridfsfile/getsize.xml @@ -0,0 +1,45 @@ + + + + + + MongoGridfsFile::getSize + Returns this file's size + + + &reftitle.description; + + public intMongoGridfsFile::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 new file mode 100644 index 0000000000..6aef2be52d --- /dev/null +++ b/reference/mongo/mongogridfsfile/write.xml @@ -0,0 +1,59 @@ + + + + + + MongoGridFSFile::write + Writes this file to the filesystem + + + &reftitle.description; + + public intMongoGridFSFile::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. + + + + diff --git a/reference/mongo/mongoutil.xml b/reference/mongo/mongoutil.xml new file mode 100644 index 0000000000..d905b925d9 --- /dev/null +++ b/reference/mongo/mongoutil.xml @@ -0,0 +1,67 @@ + + + + + + The MongoUtil class + MongoUtil + + + + +
+ &reftitle.intro; + + Some handy functions used by the other classes. + +
+ + +
+ &reftitle.classsynopsis; + + + + MongoUtil + + + + + MongoUtil + + + + + Methods + + + + +
+ +
+ + &reference.mongo.entities.mongoutil; + +
+ + diff --git a/reference/mongo/mongoutil/dbcommand.xml b/reference/mongo/mongoutil/dbcommand.xml new file mode 100644 index 0000000000..df6a150d2e --- /dev/null +++ b/reference/mongo/mongoutil/dbcommand.xml @@ -0,0 +1,81 @@ + + + + + + MongoUtil::dbCommand + Execute a db command + + + &reftitle.description; + + public static arrayMongoUtil::dbCommand + resourceconn + arraydata + stringdb + + + + &reftitle.parameters; + + + + + resource + conn + + + + Database connection. + + + + + + data + + + + The query to send. + + + + + + db + + + + The database name. + + + + + + + + &reftitle.returnvalues; + + Returns database response. + + + + diff --git a/reference/mongo/mongoutil/toindexstring.xml b/reference/mongo/mongoutil/toindexstring.xml new file mode 100644 index 0000000000..fec26d4d8f --- /dev/null +++ b/reference/mongo/mongoutil/toindexstring.xml @@ -0,0 +1,58 @@ + + + + + + MongoUtil::toIndexString + Converts a field or array of fields into an underscore-separated string + + + &reftitle.description; + + public static stringMongoUtil::toIndexString + string|arraykeys + + + + &reftitle.parameters; + + + + + keys + + + + Field(s) to convert. + + + + + + + + &reftitle.returnvalues; + + Returns the index name. + + + + diff --git a/reference/mongo/versions.xml b/reference/mongo/versions.xml index bf8fd22321..b8492df1e3 100644 --- a/reference/mongo/versions.xml +++ b/reference/mongo/versions.xml @@ -1,24 +1,96 @@ - + - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +