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
This commit is contained in:
Kristina Chodorow 2009-05-20 22:31:40 +00:00
parent d4f0413867
commit f8e05c6db9
99 changed files with 5593 additions and 1450 deletions

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 1.4 $ -->
<!-- $Revision: 1.5 $ -->
<book xml:id="book.mongo" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>Mongo</title>
@ -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;
</book>
<!-- Keep this comment at the end of the file

View file

@ -1,167 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 1.3 $ -->
<refentry xml:id="function.mongo-connect" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>mongo_connect</refname>
<refpurpose>Connects to a database</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>resource</type><methodname>mongo_connect</methodname>
<methodparam><type>string</type><parameter>server</parameter></methodparam>
<methodparam><type>string</type><parameter>username</parameter></methodparam>
<methodparam><type>string</type><parameter>password</parameter></methodparam>
<methodparam><type>bool</type><parameter>persistent</parameter></methodparam>
<methodparam><type>bool</type><parameter>paired</parameter></methodparam>
<methodparam><type>bool</type><parameter>lazy</parameter></methodparam>
</methodsynopsis>
<para>
Creates a new database connection object.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term>
<parameter>host</parameter>
</term>
<listitem>
<para>
Address of the database to which to connect.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<parameter>username</parameter>
</term>
<listitem>
<para>
An identifier for the connection. Only necessary for
persistent, authenticated connections, otherwise it can
be set to &quot;&quot;.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<parameter>password</parameter>
</term>
<listitem>
<para>
An identifier for the connection. Only necessary for
persistent, authenticated connections, otherwise it can
be set to &quot;&quot;.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<parameter>persistent</parameter>
</term>
<listitem>
<para>
If the connection should be persistent.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<parameter>paired</parameter>
</term>
<listitem>
<para>
If the paired database servers are being used.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<parameter>lazy</parameter>
</term>
<listitem>
<para>
If persistent and lazy are set and no existing
database connection is found, do not connect.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
<para>
If able to connect, the connection resource is returned.
Otherwise, false.
</para>
</refsect1>
<refsect1 role="errors">
&reftitle.errors;
<para>
If the server name is invalid (null or the empty string).
If the driver is unable to connect to the host.
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title><function>mongo_connect</function> example</title>
<para>
To connect to a Mongo database running locally on the default port:
</para>
<programlisting role="php">
<![CDATA[
<?php
$connection = mongo_connect("localhost", "", "", false, false, false);
// or, equivalently
$connection = mongo_connect("localhost:27017", "", "", false, false, false);
?>
]]>
</programlisting>
</example>
</para>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><function>mongo_close</function></member>
</simplelist>
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"../../../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->

View file

@ -1,165 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 1.3 $ -->
<refentry xml:id="function.mongo-find-one" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>mongo_find_one</refname>
<refpurpose>Queries the database for a single record</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>array</type><methodname>mongo_find_one</methodname>
<methodparam><type>resource</type><parameter>connection</parameter></methodparam>
<methodparam><type>string</type><parameter>ns</parameter></methodparam>
<methodparam><type>array</type><parameter>query</parameter></methodparam>
</methodsynopsis>
<para>
Queries the database for a single record. This can also be used for database commands.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>connection</parameter></term>
<listitem>
<para>
The database connection to use.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>ns</parameter></term>
<listitem>
<para>
A string of the form [database_name].[collection_name].
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>query</parameter></term>
<listitem>
<para>
An array representing the desired results.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Returns an array if an element matching the query was found, null otherwise.
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title><function>mongo_find_one</function> example</title>
<para>
This example shows how to find the most recently inserted record
in the collection "bar" in the database "foo".
</para>
<programlisting role="php">
<![CDATA[
<?php
$conn = mongo_connect("localhost", true);
if (!$conn) {
die("Could not connect.");
}
mongo_insert($conn, "foo.bar", array( "x" => "y" ));
var_dump(mongo_find_one($conn, "foo.bar", array()));
?>
]]>
</programlisting>
&example.outputs.similar;
<screen>
<![CDATA[
array(2) {
["_id"]=>
object(MongoId)#1 (1) {
["id"]=>
string(24) "49a2e6f55b8b4a17e843cf3d"
}
["x"]=>
string(1) "y"
}
]]>
</screen>
</example>
<example>
<title><function>mongo_find_one</function> example</title>
<para>
This example shows how to execute a database command using
the "foo" database.
</para>
<programlisting role="php">
<![CDATA[
<?php
$conn = mongo_connect("localhost", true);
if (!$conn) {
die("Could not connect.");
}
var_dump(mongo_find_one($conn, 'foo.$cmd', array('assertinfo' => 1)));
?>
]]>
</programlisting>
&example.outputs.similar;
<screen>
<![CDATA[
array(7) {
["dbasserted"]=>
bool(false)
["asserted"]=>
bool(false)
["assert"]=>
string(0) ""
["assertw"]=>
string(0) ""
["assertmsg"]=>
string(0) ""
["assertuser"]=>
string(0) ""
["ok"]=>
float(1)
}
]]>
</screen>
</example>
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"../../../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->

View file

@ -1,104 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 1.4 $ -->
<refentry xml:id="function.mongo-gridfile-write" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>mongo_gridfile_write</refname>
<refpurpose>Write a file from the database to the local filesystem</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>int</type><methodname>mongo_gridfile_write</methodname>
<methodparam><type>resource</type><parameter>gridfile</parameter></methodparam>
<methodparam><type>string</type><parameter>filename</parameter></methodparam>
</methodsynopsis>
<para>
Write a file from the database to the local filesystem.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>gridfile</parameter></term>
<listitem>
<para>
The grid file.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>filename</parameter></term>
<listitem>
<para>
Name to save the file under.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Returns the number of bytes written.
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title><function>mongo_gridfile_write</function> example</title>
<para>
This example shows a file being retrieved from the database and
saved to the local filesystem.
</para>
<programlisting role="php">
<![CDATA[
<?php
$conn = mongo_connect("localhost", true);
if (!$conn) {
die("Could not connect.");
}
// create a new grid connection
$gridfs = mongo_gridfs_init($conn, "blog", "fs");
// query for the filename
$file = mongo_gridfs_find($gridfs, array("filename" => "profilePic.jpg"));
mongo_gridfile_write($file, "pic.jpg");
?>
]]>
</programlisting>
</example>
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"../../../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->

View file

@ -1,127 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 1.5 $ -->
<refentry xml:id="function.mongo-gridfs-init" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>mongo_gridfs_init</refname>
<refpurpose>Creates a new gridfs connection</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>resource</type><methodname>mongo_gridfs_init</methodname>
<methodparam><type>resource</type><parameter>connection</parameter></methodparam>
<methodparam><type>string</type><parameter>db</parameter></methodparam>
<methodparam><type>string</type><parameter>prefix</parameter></methodparam>
</methodsynopsis>
<para>
Creates a new gridfs connection which can be used to interact with files in the database.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>connection</parameter></term>
<listitem>
<para>
The database connection to use.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>db</parameter></term>
<listitem>
<para>
The name of the database to use.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>prefix</parameter></term>
<listitem>
<para>
The prefix for the grid collections (usually <literal>"fs"</literal>).
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
A connection to the grid filesystem.
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title><function>mongo_gridfs_init</function> example</title>
<para>
This example creates a new connection and uses it to find a file
in the database.
</para>
<programlisting role="php">
<![CDATA[
<?php
$conn = mongo_connect("localhost", true);
if (!$conn) {
die("Could not connect.");
}
// create a new grid connection
$gridfs = mongo_gridfs_init($conn, "blog", "fs");
// query for the filename
$file = mongo_gridfs_find($gridfs, array("filename" => "profilePic.jpg"));
?>
]]>
</programlisting>
<para>
<literal>$jpg</literal> will now be storing a file resource.
</para>
</example>
</para>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><function>mongo_gridfs_find</function></member>
<member><function>mongo_gridfs_list</function></member>
<member><function>mongo_gridfs_store</function></member>
</simplelist>
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"../../../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->

View file

@ -1,108 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 1.4 $ -->
<refentry xml:id="function.mongo-has-next" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>mongo_has_next</refname>
<refpurpose>Checks if a cursor has any more documents to return</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>bool</type><methodname>mongo_has_next</methodname>
<methodparam><type>resource</type><parameter>cursor</parameter></methodparam>
</methodsynopsis>
<para>
Checks if a cursor has any more documents to return.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>cursor</parameter></term>
<listitem>
<para>
The database cursor to check.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
If there is another document to return.
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title><function>mongo_has_next</function> example</title>
<para>
This example shows how mongo_has_next can be used to
iterate through results.
</para>
<programlisting role="php">
<![CDATA[
<?php
$conn = mongo_connect("localhost", true);
if (!$conn) {
die("Could not connect.");
}
$cursor = mongo_query($conn, "foo.bar", array(), 0, 0, null, null, null);
while (mongo_has_next($cursor)) {
mongo_next($cursor);
echo "."
}
?>
]]>
</programlisting>
<para>
The above example will output a dot for each document in the collection foo.bar.
</para>
</example>
</para>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><function>mongo_query</function></member>
<member><function>mongo_next</function></member>
</simplelist>
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"../../../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->

View file

@ -1,128 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 1.3 $ -->
<refentry xml:id="function.mongo-insert" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>mongo_insert</refname>
<refpurpose>Inserts an array into a database collection</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>bool</type><methodname>mongo_insert</methodname>
<methodparam><type>resource</type><parameter>connection</parameter></methodparam>
<methodparam><type>string</type><parameter>ns</parameter></methodparam>
<methodparam><type>array</type><parameter>query</parameter></methodparam>
</methodsynopsis>
<para>
Inserts an array into a database collection.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>connection</parameter></term>
<listitem>
<para>
The database connection to use.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>ns</parameter></term>
<listitem>
<para>
The database and collection name
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>obj</parameter></term>
<listitem>
<para>
The array to insert.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Whether the item was successfully inserted or not.
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title><function>mongo_insert</function> example</title>
<para>
This example shows how to insert an array into a database collection.
</para>
<programlisting role="php">
<![CDATA[
<?php
$obj = array("x" => "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";
}
?>
]]>
</programlisting>
&example.outputs.similar;
<screen>
<![CDATA[
inserted
]]>
</screen>
</example>
</para>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><function>mongo_update</function></member>
<member><function>mongo_remove</function></member>
</simplelist>
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"../../../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->

View file

@ -1,115 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 1.3 $ -->
<refentry xml:id="function.mongo-next" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>mongo_next</refname>
<refpurpose>Fetches the next document returned by a query</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>array</type><methodname>mongo_next</methodname>
<methodparam><type>resource</type><parameter>cursor</parameter></methodparam>
</methodsynopsis>
<para>
Fetches the next document returned by a query.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term>
<parameter>cursor</parameter>
</term>
<listitem>
<para>
The cursor to use.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
The next document.
</para>
</refsect1>
<refsect1 role="errors">
&reftitle.errors;
<para>
Creates an error if there are no more documents.
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title><function>mongo_next</function> example</title>
<para>
This example uses mongo_has_next and mongo_next to
iterate through query results and storing them in
an array.
</para>
<programlisting role="php">
<![CDATA[
<?php
$conn = mongo_connect("localhost", true);
if (!$conn) {
die("Could not connect.");
}
$cursor = mongo_query($conn, "foo.bar", array(), 0, 0, null, null, null);
$results = array();
while (mongo_has_next($cursor)) {
$results[] = mongo_next($cursor);
}
?>
]]>
</programlisting>
</example>
</para>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><function>mongo_has_next</function></member>
</simplelist>
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"../../../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->

View file

@ -1,176 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 1.4 $ -->
<refentry xml:id="function.mongo-query" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>mongo_query</refname>
<refpurpose>Performs a basic database query</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>resource</type><methodname>mongo_query</methodname>
<methodparam><type>resource</type><parameter>connection</parameter></methodparam>
<methodparam><type>string</type><parameter>ns</parameter></methodparam>
<methodparam><type>array</type><parameter>query</parameter></methodparam>
<methodparam><type>int</type><parameter>skip</parameter></methodparam>
<methodparam><type>int</type><parameter>limit</parameter></methodparam>
<methodparam><type>array</type><parameter>sort</parameter></methodparam>
<methodparam><type>array</type><parameter>fields</parameter></methodparam>
<methodparam><type>array</type><parameter>hint</parameter></methodparam>
</methodsynopsis>
<para>
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.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>connection</parameter></term>
<listitem>
<para>
The database connection to use.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>ns</parameter></term>
<listitem>
<para>
The database and collection name
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>query</parameter></term>
<listitem>
<para>
The query to execute.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>skip</parameter></term>
<listitem>
<para>
The number of documents to skip.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>limit</parameter></term>
<listitem>
<para>
The maximum number of documents to return.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>sort</parameter></term>
<listitem>
<para>
An array of fields and directions on which to sort.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>fields</parameter></term>
<listitem>
<para>
An array of the fields of each document to return.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>hint</parameter></term>
<listitem>
<para>
An array giving the database a query hint.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Returns a cursor to the resulting documents.
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title><function>mongo_query</function> example</title>
<para>
This example shows how to use a query to get a page of
search results from the database.
</para>
<programlisting role="php">
<![CDATA[
<?php
$searchterm = "pandas";
$pagenum = 2;
$resultsPerPage = 10;
$conn = mongo_connect("localhost", true);
if (!$conn) {
die("Could not connect.");
}
$cursor = mongo_query($conn, "zoo.animals", array("name" => $searchterm), ($pagenum-1)*$resultsPerPage, $resultsPerPage, null, null, null);
?>
]]>
</programlisting>
<para>
This returns results 11-20 of objects in the zoo.animals collection with the name field "panda".
</para>
</example>
</para>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><function>mongo_has_next</function></member>
<member><function>mongo_next</function></member>
</simplelist>
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"../../../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->

View file

@ -1,130 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 1.3 $ -->
<refentry xml:id="function.mongo-remove" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>mongo_remove</refname>
<refpurpose>Removes documents from a database collection</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>bool</type><methodname>mongo_remove</methodname>
<methodparam><type>resource</type><parameter>connection</parameter></methodparam>
<methodparam><type>string</type><parameter>ns</parameter></methodparam>
<methodparam><type>array</type><parameter>query</parameter></methodparam>
<methodparam><type>bool</type><parameter>justOne</parameter></methodparam>
</methodsynopsis>
<para>
Removes objects from a database collection based on criteria.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>connection</parameter></term>
<listitem>
<para>
The database connection to use.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>ns</parameter></term>
<listitem>
<para>
The database and collection name
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>query</parameter></term>
<listitem>
<para>
Array of criteria for objects to remove.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>justOne</parameter></term>
<listitem>
<para>
If only one object matching the criteria should be removed.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
If the remove was successful.
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title><function>mongo_remove</function> example</title>
<para>
In this example, all users named Doug are deleted from
the users collection of the www database.
</para>
<programlisting role="php">
<![CDATA[
<?php
$rquery = array("username" => "Doug");
$conn = mongo_connect("localhost", true);
if (!$conn) {
die("Could not connect.");
}
$ok = mongo_remove($conn, "www.users", $rquery, false);
?>
]]>
</programlisting>
</example>
</para>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><function>mongo_insert</function></member>
<member><function>mongo_update</function></member>
</simplelist>
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"../../../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->

View file

@ -1,152 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 1.4 $ -->
<refentry xml:id="function.mongo-update" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>mongo_update</refname>
<refpurpose>Updates objects in a database collection</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>bool</type><methodname>mongo_update</methodname>
<methodparam><type>resource</type><parameter>connection</parameter></methodparam>
<methodparam><type>string</type><parameter>ns</parameter></methodparam>
<methodparam><type>array</type><parameter>query</parameter></methodparam>
<methodparam><type>array</type><parameter>newobj</parameter></methodparam>
<methodparam><type>bool</type><parameter>upsert</parameter></methodparam>
</methodsynopsis>
<para>
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.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>connection</parameter></term>
<listitem>
<para>
The database connection to use.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>ns</parameter></term>
<listitem>
<para>
The database and collection name
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>query</parameter></term>
<listitem>
<para>
The object for which to query.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>newobj</parameter></term>
<listitem>
<para>
The object to replace matches with.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>upsert</parameter></term>
<listitem>
<para>
Whether to insert newobj into the collection
if no objects are returned by the query.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
If the update was successful.
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title><function>mongo_update</function> example</title>
<para>
This example shows how to update an existing object.
</para>
<programlisting role="php">
<![CDATA[
<?php
$query = array("x" => "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";
}
?>
]]>
</programlisting>
&example.outputs.similar;
<screen>
<![CDATA[
updated
]]>
</screen>
</example>
</para>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><function>mongo_insert</function></member>
<member><function>mongo_remove</function></member>
</simplelist>
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"../../../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.4 $ -->
<!-- $Revision: 1.5 $ -->
<section xml:id="mongo.configuration" xmlns="http://docbook.org/ns/docbook">
&reftitle.runtime;
&extension.runtime;
@ -18,32 +18,37 @@
<tbody>
<row>
<entry><link linkend="ini.mongo.default-host">mongo.default_host</link></entry>
<entry>NULL</entry>
<entry>"localhost"</entry>
<entry>PHP_INI_ALL</entry>
</row>
<row>
<entry><link linkend="ini.mongo.default-port">mongo.default_port</link></entry>
<entry>NULL</entry>
<entry>27017</entry>
<entry>PHP_INI_ALL</entry>
</row>
<row>
<entry><link linkend="ini.mongo.auto-reconnect">mongo.auto_reconnect</link></entry>
<entry>NULL</entry>
<entry>0</entry>
<entry>PHP_INI_SYSTEM</entry>
</row>
<row>
<entry><link linkend="ini.mongo.allow-persistent">mongo.allow_persistent</link></entry>
<entry>NULL</entry>
<entry>1</entry>
<entry>PHP_INI_SYSTEM</entry>
</row>
<row>
<entry><link linkend="ini.mongo.max-persistent">mongo.max_persistent</link></entry>
<entry>NULL</entry>
<entry>-1</entry>
<entry>PHP_INI_SYSTEM</entry>
</row>
<row>
<entry><link linkend="ini.mongo.max-connections">mongo.max_connections</link></entry>
<entry>NULL</entry>
<entry>-1</entry>
<entry>PHP_INI_SYSTEM</entry>
</row>
<row>
<entry><link linkend="ini.mongo.chunk-size">mongo.chunk_size</link></entry>
<entry>262144</entry>
<entry>PHP_INI_SYSTEM</entry>
</row>
</tbody>
@ -133,6 +138,18 @@
</listitem>
</varlistentry>
<varlistentry xml:id="ini.mongo.chunk-size">
<term>
<parameter>mongo.chunk_size</parameter>
<type>int</type>
</term>
<listitem>
<para>
The number of bytes-per-chunk. Used in divvying up GridFS files.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</section>

78
reference/mongo/mongo.xml Normal file
View file

@ -0,0 +1,78 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 1.1 $ -->
<phpdoc:classref xml:id="class.mongo" xmlns:phpdoc="http://php.net/ns/phpdoc" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xi="http://www.w3.org/2001/XInclude">
<title>The Mongo class</title>
<titleabbrev>Mongo</titleabbrev>
<partintro>
<!-- {{{ Mongo intro -->
<section xml:id="mongo.intro">
&reftitle.intro;
<para>
The connection point between MongoDB and PHP.
</para>
<para>
This class is used to initiate a connection and for database server commands.
A typical use is:
<programlisting role="php">
<![CDATA[
<?php
$m = new Mongo(); // connect
$db = $m->selectDatabase(); // get a database object
?>
]]>
</programlisting>
</para>
</section>
<!-- }}} -->
<section xml:id="mongo.synopsis">
&reftitle.classsynopsis;
<!-- {{{ Synopsis -->
<classsynopsis>
<ooclass><classname>Mongo</classname></ooclass>
<!-- {{{ Class synopsis -->
<classsynopsisinfo>
<ooclass>
<classname>Mongo</classname>
</ooclass>
</classsynopsisinfo>
<!-- }}} -->
<classsynopsisinfo role="comment">Methods</classsynopsisinfo>
<xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('class.mongo')/db:refentry/db:refsect1[@role='description']/descendant::db:methodsynopsis[1])" />
</classsynopsis>
<!-- }}} -->
</section>
</partintro>
&reference.mongo.entities.mongo;
</phpdoc:classref>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->

View file

@ -0,0 +1,48 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 1.1 $ -->
<refentry xml:id="mongo.close" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>Mongo::close</refname>
<refpurpose>Closes this database connection</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<modifier>public</modifier> <type>boolean</type><methodname>Mongo::close</methodname>
<void/>
</methodsynopsis>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
&no.function.parameters;
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Returns if the connection was successfully closed.
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
sgml-parent-document:nil
sgml-default-dtd-file:"../../../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->

View file

@ -0,0 +1,56 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 1.1 $ -->
<refentry xml:id="mongo.connect" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>Mongo::connect</refname>
<refpurpose>Connects to a database server</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<modifier>public</modifier> <type>boolean</type><methodname>Mongo::connect</methodname>
<void/>
</methodsynopsis>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
&no.function.parameters;
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
If the connection was successful.
</para>
</refsect1>
<refsect1 role="errors">
&reftitle.errors;
<para>
Throws MongoConnectionException if it fails to connect to the database.
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
sgml-parent-document:nil
sgml-default-dtd-file:"../../../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->

View file

@ -1,22 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 1.3 $ -->
<refentry xml:id="function.mongo-gridfs-store" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<!-- $Revision: 1.1 $ -->
<refentry xml:id="mongo.connectutil" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>mongo_gridfs_store</refname>
<refpurpose>Store a file in the database</refpurpose>
<refname>Mongo::connectUtil</refname>
<refpurpose>Connects with a database server</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>MongoId</type><methodname>mongo_gridfs_store</methodname>
<methodparam><type>resource</type><parameter>gridfs</parameter></methodparam>
<methodparam><type>string</type><parameter>filename</parameter></methodparam>
<modifier>protected</modifier> <type>boolean</type><methodname>Mongo::connectUtil</methodname>
<methodparam><type>string</type><parameter>username</parameter></methodparam>
<methodparam><type>string</type><parameter>password</parameter></methodparam>
</methodsynopsis>
<para>
Store a file in the database.
</para>
</refsect1>
<refsect1 role="parameters">
@ -24,18 +21,22 @@
<para>
<variablelist>
<varlistentry>
<term><parameter>gridfs</parameter></term>
<term>
<parameter>username</parameter>
</term>
<listitem>
<para>
The gridfs connection to use.
A username used to identify the connection.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>filename</parameter></term>
<term>
<parameter>password</parameter>
</term>
<listitem>
<para>
Name of the file to store.
A password used to identify the connection.
</para>
</listitem>
</varlistentry>
@ -46,23 +47,18 @@
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
The MongoId given to the file saved to the database.
If the connection was successful.
</para>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<refsect1 role="errors">
&reftitle.errors;
<para>
<simplelist>
<member><function>mongo_gridfs_init</function></member>
<member><function>mongo_gridfs_find</function></member>
<member><function>mongo_gridfs_list</function></member>
</simplelist>
Throws MongoConnectionException if it fails to connect to the databases.
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
@ -72,7 +68,6 @@ sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"../../../../manual.ced"
sgml-exposed-tags:nil
@ -82,4 +77,4 @@ End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->
-->

View file

@ -0,0 +1,102 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 1.1 $ -->
<refentry xml:id="mongo.construct" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>Mongo::__construct</refname>
<refpurpose>Creates a new database connection object</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<methodname>Mongo::__construct</methodname>
<methodparam choice="opt"><type>string</type><parameter>server</parameter><initializer>&null;</initializer></methodparam>
<methodparam choice="opt"><type>boolean</type><parameter>connect</parameter><initializer>&true;</initializer></methodparam>
<methodparam choice="opt"><type>boolean</type><parameter>persistent</parameter><initializer>&false;</initializer></methodparam>
<methodparam choice="opt"><type>boolean</type><parameter>paired</parameter><initializer>&false;</initializer></methodparam>
</methodsynopsis>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term>
<parameter>server</parameter>
</term>
<listitem>
<para>
The server name.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<parameter>connect</parameter>
</term>
<listitem>
<para>
If the driver should connect to the database before returning.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<parameter>persistent</parameter>
</term>
<listitem>
<para>
If the connection should be persistent.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<parameter>paired</parameter>
</term>
<listitem>
<para>
If the connection should be paired.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Returns a new database connection object.
</para>
</refsect1>
<refsect1 role="errors">
&reftitle.errors;
<para>
Throws MongoConnectionException if it tries and fails to connect to the database.
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
sgml-parent-document:nil
sgml-default-dtd-file:"../../../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->

View file

@ -0,0 +1,61 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 1.1 $ -->
<refentry xml:id="mongo.dropdb" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>Mongo::dropDB</refname>
<refpurpose>Drops a database</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<modifier>public</modifier> <type>array</type><methodname>Mongo::dropDB</methodname>
<methodparam><type>mixed</type><parameter>db</parameter></methodparam>
</methodsynopsis>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term>
<parameter>db</parameter>
</term>
<listitem>
<para>
The database to drop. Can be a MongoDB object or the name of the database.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Returns the database response.
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
sgml-parent-document:nil
sgml-default-dtd-file:"../../../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->

View file

@ -0,0 +1,48 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 1.1 $ -->
<refentry xml:id="mongo.forceerror" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname><function>Mongo::forceError</function></refname>
<refpurpose>Creates a database error</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<modifier>public</modifier> <type>bool</type><methodname>Mongo::forceError</methodname>
<void/>
</methodsynopsis>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
&no.function.parameters;
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Returns the database response.
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
sgml-parent-document:nil
sgml-default-dtd-file:"../../../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->

View file

@ -0,0 +1,48 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 1.1 $ -->
<refentry xml:id="mongo.lasterror" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>Mongo::lastError</refname>
<refpurpose>Check if there was an error on the most recent db operation performed</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<modifier>public</modifier> <type>string</type><methodname>Mongo::lastError</methodname>
<void/>
</methodsynopsis>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
&no.function.parameters;
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Returns the error, if there was one, or &null;.
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
sgml-parent-document:nil
sgml-default-dtd-file:"../../../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->

View file

@ -0,0 +1,60 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 1.1 $ -->
<refentry xml:id="mongo.pairconnect" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>Mongo::pairConnect</refname>
<refpurpose>Connects to paired database server</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<modifier>public</modifier> <type>boolean</type><methodname>Mongo::pairConnect</methodname>
<void/>
</methodsynopsis>
<para>
To successfully create a paired connection, <literal>$this->server</literal> must be a string
of the form "server1,server2".
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
&no.function.parameters;
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
If the connection was successful.
</para>
</refsect1>
<refsect1 role="errors">
&reftitle.errors;
<para>
Throws MongoConnectionException if it fails to connect to the databases.
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
sgml-parent-document:nil
sgml-default-dtd-file:"../../../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->

View file

@ -0,0 +1,80 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 1.1 $ -->
<refentry xml:id="mongo.pairpersistconnect" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>Mongo::pairPersistConnect</refname>
<refpurpose>Creates a persistent connection with paired database servers</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<modifier>public</modifier> <type>boolean</type><methodname>Mongo::pairPersistConnect</methodname>
<methodparam choice="opt"><type>string</type><parameter>username</parameter><initializer>""</initializer></methodparam>
<methodparam choice="opt"><type>string</type><parameter>password</parameter><initializer>""</initializer></methodparam>
</methodsynopsis>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term>
<parameter>username</parameter>
</term>
<listitem>
<para>
A username used to identify the connection.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<parameter>password</parameter>
</term>
<listitem>
<para>
A password used to identify the connection.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
If the connection was successful.
</para>
</refsect1>
<refsect1 role="errors">
&reftitle.errors;
<para>
Throws MongoConnectionException if it fails to connect to the databases.
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
sgml-parent-document:nil
sgml-default-dtd-file:"../../../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->

View file

@ -0,0 +1,80 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 1.1 $ -->
<refentry xml:id="mongo.persistconnect" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>Mongo::persistConnect</refname>
<refpurpose>Creates a persistent connection with a database server</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<modifier>public</modifier> <type>boolean</type><methodname>Mongo::persistConnect</methodname>
<methodparam choice="opt"><type>string</type><parameter>username</parameter><initializer>""</initializer></methodparam>
<methodparam choice="opt"><type>string</type><parameter>password</parameter><initializer>""</initializer></methodparam>
</methodsynopsis>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term>
<parameter>username</parameter>
</term>
<listitem>
<para>
A username used to identify the connection.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<parameter>password</parameter>
</term>
<listitem>
<para>
A password used to identify the connection.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
If the connection was successful.
</para>
</refsect1>
<refsect1 role="errors">
&reftitle.errors;
<para>
Throws MongoConnectionException if it fails to connect to the databases.
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
sgml-parent-document:nil
sgml-default-dtd-file:"../../../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->

View file

@ -0,0 +1,48 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 1.1 $ -->
<refentry xml:id="mongo.preverror" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>Mongo::prevError</refname>
<refpurpose>Checks for the last error thrown during a database operation</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<modifier>public</modifier> <type>array</type><methodname>Mongo::prevError</methodname>
<void/>
</methodsynopsis>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
&no.function.parameters;
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Returns the error and the number of operations ago it occured.
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
sgml-parent-document:nil
sgml-default-dtd-file:"../../../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->

View file

@ -0,0 +1,83 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 1.1 $ -->
<refentry xml:id="mongo.repairdb" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>Mongo::repairDB</refname>
<refpurpose>Repairs and compacts a database</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<modifier>public</modifier> <type>array</type><methodname>Mongo::repairDB</methodname>
<methodparam><type>MongoDB</type><parameter>db</parameter></methodparam>
<methodparam choice="opt"><type>boolean</type><parameter>preserve_cloned_files</parameter><initializer>false</initializer></methodparam>
<methodparam choice="opt"><type>boolean</type><parameter>backup_original_files</parameter><initializer>false</initializer></methodparam>
</methodsynopsis>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term>
<parameter>db</parameter>
</term>
<listitem>
<para>
The database to drop.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<parameter>preserve_cloned_files</parameter>
</term>
<listitem>
<para>
If cloned files should be kept if the repair fails.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<parameter>backup_original_files</parameter>
</term>
<listitem>
<para>
If original files should be backed up.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Returns the database response.
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
sgml-parent-document:nil
sgml-default-dtd-file:"../../../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->

View file

@ -0,0 +1,48 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 1.1 $ -->
<refentry xml:id="mongo.reseterror" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>Mongo::resetError</refname>
<refpurpose>Clears any flagged errors on the connection</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<modifier>public</modifier> <type>array</type><methodname>Mongo::resetError</methodname>
<void/>
</methodsynopsis>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
&no.function.parameters;
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Returns the database response.
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
sgml-parent-document:nil
sgml-default-dtd-file:"../../../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->

View file

@ -0,0 +1,88 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 1.1 $ -->
<refentry xml:id="mongo.selectcollection" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname><function>Mongo::selectCollection</function></refname>
<refpurpose>Gets a database collection</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<modifier>public</modifier> <type>MongoCollection</type><methodname>Mongo::selectCollection</methodname>
<methodparam><type>string</type>|<type>MongoDB</type><parameter>db</parameter></methodparam>
<methodparam><type>string</type><parameter>collection</parameter></methodparam>
</methodsynopsis>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term>
<parameter>db</parameter>
</term>
<listitem>
<para>
The database name.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<parameter>collection</parameter>
</term>
<listitem>
<para>
The collection name.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Returns a new collection object.
</para>
</refsect1>
<refsect1 role="errors">
&reftitle.errors;
<para>
Throws InvalidArgumentException if the database or collection name is invalid.
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<example>
<title><function>Mongo::selectCollection</function> example</title>
<programlisting role="php">
<![CDATA[
<?php
$m = new Mongo();
$c1 = $m->selectCollection("foo", "bar.baz");
// which is equivalent to
$c2 = $m->selectDB("foo")->selectCollection("bar.baz");
// $c1 and $c2 now represent the same collection
?>
]]>
</programlisting>
</example>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file Local variables: mode:
sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil
sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t
sgml-parent-document:nil
sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil
sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml
fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1
-->

View file

@ -0,0 +1,69 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 1.1 $ -->
<refentry xml:id="mongo.selectdb" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>Mongo::selectDB</refname>
<refpurpose>Gets a database</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<modifier>public</modifier> <type>MongoDB</type><methodname>Mongo::selectDB</methodname>
<methodparam><type>string</type><parameter>dbname</parameter></methodparam>
</methodsynopsis>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term>
<parameter>dbname</parameter>
</term>
<listitem>
<para>
The database name.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Returns a new db object.
</para>
</refsect1>
<refsect1 role="errors">
&reftitle.errors;
<para>
Throws InvalidArgumentException if the database name is invalid.
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
sgml-parent-document:nil
sgml-default-dtd-file:"../../../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->

View file

@ -0,0 +1,48 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 1.1 $ -->
<refentry xml:id="mongo.tostring" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>Mongo::__toString</refname>
<refpurpose>String representation of this connection</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<modifier>public</modifier> <type>string</type><methodname>Mongo::__toString</methodname>
<void/>
</methodsynopsis>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
&no.function.parameters;
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Returns hostname and port for this connection.
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
sgml-parent-document:nil
sgml-default-dtd-file:"../../../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 1.1 $ -->
<!-- $Revision: 1.2 $ -->
<refentry xml:id="mongobindata.construct" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
@ -10,7 +10,7 @@
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<methodname>MongoBinData::__construct</methodname>
<modifier>public</modifier> <methodname>MongoBinData::__construct</methodname>
<methodparam><type>string</type><parameter>data</parameter></methodparam>
<methodparam choice="opt"><type>int</type><parameter>type</parameter></methodparam>
</methodsynopsis>

View file

@ -0,0 +1,72 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 1.1 $ -->
<phpdoc:classref xml:id="class.mongocollection" xmlns:phpdoc="http://php.net/ns/phpdoc" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xi="http://www.w3.org/2001/XInclude">
<title>The MongoCollection class</title>
<titleabbrev>MongoCollection</titleabbrev>
<partintro>
<!-- {{{ Mongocollection intro -->
<section xml:id="mongocollection.intro">
&reftitle.intro;
<para>
Representations a database collection.
</para>
<para>
Collection names cannot have a &quot;$&quot; in them, but other than that
they can use any character in the ASCII set. Some valid collection
names are &quot;&quot;, &quot;...&quot;, &quot;my collection&quot;, and &quot;&#42;&amp;&#35;&#64;&quot;.
</para>
</section>
<!-- }}} -->
<section xml:id="mongocollection.synopsis">
&reftitle.classsynopsis;
<!-- {{{ Synopsis -->
<classsynopsis>
<ooclass><classname>MongoCollection</classname></ooclass>
<!-- {{{ Class synopsis -->
<classsynopsisinfo>
<ooclass>
<classname>MongoCollection</classname>
</ooclass>
</classsynopsisinfo>
<!-- }}} -->
<classsynopsisinfo role="comment">Methods</classsynopsisinfo>
<xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('class.mongocollection')/db:refentry/db:refsect1[@role='description']/descendant::db:methodsynopsis[1])" />
</classsynopsis>
<!-- }}} -->
</section>
</partintro>
&reference.mongo.entities.mongocollection;
</phpdoc:classref>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->

View file

@ -0,0 +1,100 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 1.1 $ -->
<refentry xml:id="mongocollection.batchinsert" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>MongoCollection::batchInsert</refname>
<refpurpose>Inserts an array of arrays into the collection</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<modifier>public</modifier> <type>boolean</type><methodname>MongoCollection::batchInsert</methodname>
<methodparam><type>array</type><parameter>a</parameter></methodparam>
</methodsynopsis>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term>
<parameter>a</parameter>
</term>
<listitem>
<para>
An array of arrays.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Returns if the arrays were saved.
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<example>
<title><function>MongoCollection::batchInsert</function> example</title>
<para>
Batch insertion is a quick way to add many elements to the database at once
</para>
<programlisting role="php">
<![CDATA[
<?php
$batch = array();
for ($i=0; $i<100; $i++) {
$batch[] = array("i" => 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"]);
}
?>
]]>
</programlisting>
&example.outputs.similar;
<screen>
<![CDATA[
int(0)
int(1)
int(2)
...
]]>
</screen>
</example>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
sgml-parent-document:nil
sgml-default-dtd-file:"../../../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->

View file

@ -0,0 +1,83 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 1.1 $ -->
<refentry xml:id="mongocollection.construct" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>MongoCollection::__construct</refname>
<refpurpose>Creates a new collection</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<modifier>public</modifier> <methodname>MongoCollection::__construct</methodname>
<methodparam><type>MongoDB</type><parameter>db</parameter></methodparam>
<methodparam><type>string</type><parameter>name</parameter></methodparam>
</methodsynopsis>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term>
<type>MongoDB</type>
<parameter>db</parameter>
</term>
<listitem>
<para>
Database.
</para>
</listitem>
</varlistentry>
</variablelist>
<variablelist>
<varlistentry>
<term>
<parameter>name</parameter>
</term>
<listitem>
<para>
Collection name.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Returns a new collection object.
</para>
</refsect1>
<refsect1 role="errors">
&reftitle.errors;
<para>
Throws InvalidArgumentException if the collection name is invalid.
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
sgml-parent-document:nil
sgml-default-dtd-file:"../../../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->

View file

@ -0,0 +1,48 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 1.1 $ -->
<refentry xml:id="mongocollection.count" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>MongoCollection::count</refname>
<refpurpose>Counts the number of documents in this collection</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<modifier>public</modifier> <type>int</type><methodname>MongoCollection::count</methodname>
<void />
</methodsynopsis>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
&no.function.parameters;
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Returns the number of documents.
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
sgml-parent-document:nil
sgml-default-dtd-file:"../../../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->

View file

@ -0,0 +1,61 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 1.1 $ -->
<refentry xml:id="mongocollection.createdbref" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>MongoCollection::createDBRef</refname>
<refpurpose>Creates a database reference</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<modifier>public</modifier> <type>array</type><methodname>MongoCollection::createDBRef</methodname>
<methodparam><type>array</type><parameter>a</parameter></methodparam>
</methodsynopsis>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term>
<parameter>a</parameter>
</term>
<listitem>
<para>
Object to which to create a reference.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Returns a database reference array.
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
sgml-parent-document:nil
sgml-default-dtd-file:"../../../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->

View file

@ -0,0 +1,92 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 1.1 $ -->
<refentry xml:id="mongocollection.deleteindex" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>MongoCollection::deleteIndex</refname>
<refpurpose>Deletes an index from this collection</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<modifier>public</modifier> <type>array</type><methodname>MongoCollection::deleteIndex</methodname>
<methodparam><type>string|array</type><parameter>keys</parameter></methodparam>
</methodsynopsis>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term>
<parameter>keys</parameter>
</term>
<listitem>
<para>
Field or fields from which to delete the index.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Returns the database response.
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<example>
<title><function>MongoCollection::deleteIndex</function> example</title>
<para>
This example passes the function string and array parameters.
</para>
<programlisting role="php">
<![CDATA[
<?php
$m = new Mongo();
$c = $m->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));
?>
]]>
</programlisting>
</example>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
sgml-parent-document:nil
sgml-default-dtd-file:"../../../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->

View file

@ -0,0 +1,49 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 1.1 $ -->
<refentry xml:id="mongocollection.deleteindexes" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>MongoCollection::deleteIndexes</refname>
<refpurpose>Delete all indices for this collection</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<modifier>public</modifier> <type>array</type><methodname>MongoCollection::deleteIndexes</methodname>
<void/>
</methodsynopsis>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
&no.function.parameters;
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Returns the database response.
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
sgml-parent-document:nil
sgml-default-dtd-file:"../../../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->

View file

@ -0,0 +1,51 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 1.1 $ -->
<refentry xml:id="mongocollection.drop" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>MongoCollection::drop</refname>
<refpurpose>Drops this collection</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<modifier>public</modifier> <type>array</type><methodname>MongoCollection::drop</methodname>
<void/>
</methodsynopsis>
<para>
Drops this collection and deletes its indices.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
&no.function.parameters;
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Returns the database response.
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
sgml-parent-document:nil
sgml-default-dtd-file:"../../../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->

View file

@ -0,0 +1,93 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 1.1 $ -->
<refentry xml:id="mongocollection.ensureindex" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>MongoCollection::ensureIndex</refname>
<refpurpose>
Creates an index on the given field(s), or does nothing if the index
already exists
</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<modifier>public</modifier> <type>boolean</type><methodname>MongoCollection::ensureIndex</methodname>
<methodparam><type>string|array</type><parameter>keys</parameter></methodparam>
</methodsynopsis>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term>
<parameter>keys</parameter>
</term>
<listitem>
<para>
Field or fields to use as index.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Returns &true;.
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<example>
<title><function>MongoCollection::ensureIndex</function> example</title>
<programlisting role="php">
<![CDATA[
<?php
$c = new MongoCollection($db, 'foo');
// create an index on 'x' ascending
$c->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));
?>
]]>
</programlisting>
</example>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
sgml-parent-document:nil
sgml-default-dtd-file:"../../../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->

View file

@ -0,0 +1,71 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 1.1 $ -->
<refentry xml:id="mongocollection.find" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>MongoCollection::find</refname>
<refpurpose>Querys this collection</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<modifier>public</modifier> <type>MongoCursor</type><methodname>MongoCollection::find</methodname>
<methodparam choice="opt"><type>array</type><parameter>query</parameter><initializer>array()</initializer></methodparam>
<methodparam choice="opt"><type>array</type><parameter>fields</parameter><initializer>array()</initializer></methodparam>
</methodsynopsis>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term>
<parameter>query</parameter>
</term>
<listitem>
<para>
The fields for which to search.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<parameter>fields</parameter>
</term>
<listitem>
<para>
Fields of the results to return.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Returns a cursor for the search results.
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
sgml-parent-document:nil
sgml-default-dtd-file:"../../../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->

View file

@ -0,0 +1,60 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 1.1 $ -->
<refentry xml:id="mongocollection.findone" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>MongoCollection::findOne</refname>
<refpurpose>Querys this collection, returning a single element</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<modifier>public</modifier> <type>array</type><methodname>MongoCollection::findOne</methodname>
<methodparam choice="opt"><type>array</type><parameter>query</parameter><initializer>array()</initializer></methodparam>
</methodsynopsis>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term>
<parameter>query</parameter>
</term>
<listitem>
<para>
The fields for which to search.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Returns record matching the search or &null;.
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
sgml-parent-document:nil
sgml-default-dtd-file:"../../../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->

View file

@ -0,0 +1,61 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 1.1 $ -->
<refentry xml:id="mongocollection.getdbref" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>MongoCollection::getDBRef</refname>
<refpurpose>Fetches a database reference</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<modifier>public</modifier> <type>array</type><methodname>MongoCollection::getDBRef</methodname>
<methodparam><type>array</type><parameter>ref</parameter></methodparam>
</methodsynopsis>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term>
<parameter>ref</parameter>
</term>
<listitem>
<para>
A database reference.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Returns the database document pointed to by the reference.
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
sgml-parent-document:nil
sgml-default-dtd-file:"../../../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->

View file

@ -0,0 +1,48 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 1.1 $ -->
<refentry xml:id="mongocollection.getindexinfo" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>MongoCollection::getIndexInfo</refname>
<refpurpose>Returns an array of index names for this collection</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<modifier>public</modifier> <type>array</type><methodname>MongoCollection::getIndexInfo</methodname>
<void/>
</methodsynopsis>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
&no.function.parameters;
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Returns a list of index names.
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
sgml-parent-document:nil
sgml-default-dtd-file:"../../../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->

View file

@ -0,0 +1,73 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 1.1 $ -->
<refentry xml:id="mongocollection.getname" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>MongoCollection::getName</refname>
<refpurpose>Returns this collection&apos;s name</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<modifier>public</modifier> <type>string</type><methodname>MongoCollection::getName</methodname>
<void />
</methodsynopsis>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
&no.function.parameters;
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Returns the name of this collection.
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title><function>MongoCollection::getName</function> example</title>
<programlisting role="php">
<![CDATA[
<?php
$m = new Mongo();
$c = $m->selectDB("foo")->selectCollection("bar.baz");
echo "Working with collection " . $c->getName() . ".";
?>
]]>
</programlisting>
&example.outputs.similar;
<screen>
<![CDATA[
Working with collection bar.baz.
]]>
</screen>
</example>
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
sgml-parent-document:nil
sgml-default-dtd-file:"../../../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->

View file

@ -0,0 +1,61 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 1.1 $ -->
<refentry xml:id="mongocollection.insert" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>MongoCollection::insert</refname>
<refpurpose>Inserts an array into the collection</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<modifier>public</modifier> <type>boolean</type><methodname>MongoCollection::insert</methodname>
<methodparam><type>array</type><parameter>a</parameter></methodparam>
</methodsynopsis>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term>
<parameter>a</parameter>
</term>
<listitem>
<para>
An array.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Returns if the array was inserted.
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
sgml-parent-document:nil
sgml-default-dtd-file:"../../../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->

View file

@ -0,0 +1,71 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 1.1 $ -->
<refentry xml:id="mongocollection.remove" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>MongoCollection::remove</refname>
<refpurpose>Remove records from this collection</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<modifier>public</modifier> <type>boolean</type><methodname>MongoCollection::remove</methodname>
<methodparam><type>array</type><parameter>criteria</parameter></methodparam>
<methodparam choice="opt"><type>boolean</type><parameter>justOne</parameter><initializer>&false;</initializer></methodparam>
</methodsynopsis>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term>
<parameter>criteria</parameter>
</term>
<listitem>
<para>
Description of records to remove.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<parameter>just_one</parameter>
</term>
<listitem>
<para>
Remove at most one record matching this criteria.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Returns if the command was executed successfully.
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
sgml-parent-document:nil
sgml-default-dtd-file:"../../../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->

View file

@ -1,35 +1,38 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 1.3 $ -->
<refentry xml:id="function.mongo-close" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<!-- $Revision: 1.1 $ -->
<refentry xml:id="mongocollection.save" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>mongo_close</refname>
<refpurpose>Closes a connection to the database</refpurpose>
<refname>MongoCollection::save</refname>
<refpurpose>Saves an object to this collection</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>bool</type><methodname>mongo_close</methodname>
<methodparam><type>resource</type><parameter>connection</parameter></methodparam>
<modifier>public</modifier> <type>boolean</type><methodname>MongoCollection::save</methodname>
<methodparam><type>array</type><parameter>a</parameter></methodparam>
</methodsynopsis>
<para>
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.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>connection</parameter></term>
<term>
<parameter>a</parameter>
</term>
<listitem>
<para>
The database connection to close.
Array to save.
</para>
</listitem>
</varlistentry>
</varlistentry>
</variablelist>
</para>
</refsect1>
@ -37,22 +40,10 @@
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
&return.success;
Returns if the object was saved.
</para>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><function>mongo_connect</function></member>
</simplelist>
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
@ -62,7 +53,6 @@ sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"../../../../manual.ced"
sgml-exposed-tags:nil
@ -72,4 +62,4 @@ End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->
-->

View file

@ -0,0 +1,73 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 1.1 $ -->
<refentry xml:id="mongocollection.--tostring" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>MongoCollection::__toString</refname>
<refpurpose>String representation of this collection</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<modifier>public</modifier> <type>string</type><methodname>MongoCollection::__toString</methodname>
<void />
</methodsynopsis>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
&no.function.parameters;
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Returns the full name of this collection.
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title><function>MongoCollection::__toString</function> example</title>
<programlisting role="php">
<![CDATA[
<?php
$m = new Mongo();
$c = $m->selectDB("foo")->selectCollection("bar.baz");
echo "Working with collection $c.";
?>
]]>
</programlisting>
&example.outputs.similar;
<screen>
<![CDATA[
Working with collection foo.bar.baz.
]]>
</screen>
</example>
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
sgml-parent-document:nil
sgml-default-dtd-file:"../../../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->

View file

@ -0,0 +1,82 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 1.1 $ -->
<refentry xml:id="mongocollection.update" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>MongoCollection::update</refname>
<refpurpose>Update records based on a given criteria</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<modifier>public</modifier> <type>boolean</type><methodname>MongoCollection::update</methodname>
<methodparam><type>array</type><parameter>criteria</parameter></methodparam>
<methodparam><type>array</type><parameter>newobj</parameter></methodparam>
<methodparam choice="opt"><type>boolean</type><parameter>upsert</parameter><initializer>&false;</initializer></methodparam>
</methodsynopsis>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term>
<parameter>criteria</parameter>
</term>
<listitem>
<para>
Description of the objects to update.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<parameter>newobj</parameter>
</term>
<listitem>
<para>
The object with which to update the matching records.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<parameter>upsert</parameter>
</term>
<listitem>
<para>
If <literal>$newobj</literal> should be inserted if the criteria is not found.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Returns if the update was successful.
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
sgml-parent-document:nil
sgml-default-dtd-file:"../../../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->

View file

@ -0,0 +1,61 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 1.1 $ -->
<refentry xml:id="mongocollection.validate" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>MongoCollection::validate</refname>
<refpurpose>Validates this collection</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<modifier>public</modifier> <type>array</type><methodname>MongoCollection::validate</methodname>
<methodparam choice="opt"><type>bool</type><parameter>scan_data</parameter><initializer>&false;</initializer></methodparam>
</methodsynopsis>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term>
<parameter>scan_data</parameter>
</term>
<listitem>
<para>
Only validate indices, not the base collection.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Returns the database&apos;s evaluation of this object.
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
sgml-parent-document:nil
sgml-default-dtd-file:"../../../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->

View file

@ -0,0 +1,86 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 1.1 $ -->
<phpdoc:classref xml:id="class.mongocursor" xmlns:phpdoc="http://php.net/ns/phpdoc" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xi="http://www.w3.org/2001/XInclude">
<title>The MongoCursor class</title>
<titleabbrev>MongoCursor</titleabbrev>
<partintro>
<!-- {{{ Mongocursor intro -->
<section xml:id="mongocursor.intro">
&reftitle.intro;
<para>
Result object for database query.
</para>
<para>
The database is not actually queried until next() or hasNext() is called.
Before the database is queried, commands can be strung together, as in:
<![CDATA[
<?php
$cursor = $collection->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);
?>
]]>
</para>
</section>
<!-- }}} -->
<section xml:id="mongocursor.synopsis">
&reftitle.classsynopsis;
<!-- {{{ Synopsis -->
<classsynopsis>
<ooclass><classname>MongoCursor</classname></ooclass>
<!-- {{{ Class synopsis -->
<classsynopsisinfo>
<ooclass>
<modifier>implements</modifier>
<classname>Iterator</classname>
</ooclass>
</classsynopsisinfo>
<!-- }}} -->
<classsynopsisinfo role="comment">Methods</classsynopsisinfo>
<xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('class.mongocursor')/db:refentry/db:refsect1[@role='description']/descendant::db:methodsynopsis[1])" />
</classsynopsis>
<!-- }}} -->
</section>
</partintro>
&reference.mongo.entities.mongocursor;
</phpdoc:classref>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->

View file

@ -0,0 +1,95 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 1.1 $ -->
<refentry xml:id="mongocursor.construct" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>MongoCursor::__construct</refname>
<refpurpose>Create a new cursor</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<methodname>MongoCursor::__construct</methodname>
<methodparam><type>resource</type><parameter>connection</parameter></methodparam>
<methodparam><type>string</type><parameter>ns</parameter></methodparam>
<methodparam choice="opt"><type>array</type><parameter>query</parameter><initializer>array()</initializer></methodparam>
<methodparam choice="opt"><type>array</type><parameter>fields</parameter><initializer>array()</initializer></methodparam>
</methodsynopsis>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term>
<parameter>connection</parameter>
</term>
<listitem>
<para>
Database connection.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<parameter>ns</parameter>
</term>
<listitem>
<para>
Full name of database and collection.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<parameter>query</parameter>
</term>
<listitem>
<para>
Database query.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<parameter>fields</parameter>
</term>
<listitem>
<para>
Fields to return.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Returns the new cursor.
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
sgml-parent-document:nil
sgml-default-dtd-file:"../../../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->

View file

@ -0,0 +1,48 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 1.1 $ -->
<refentry xml:id="mongocursor.current" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>MongoCursor::current</refname>
<refpurpose>Returns the current result</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<modifier>public</modifier> <type>array</type><methodname>MongoCursor::current</methodname>
<void/>
</methodsynopsis>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
&no.function.parameters;
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
The current result.
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
sgml-parent-document:nil
sgml-default-dtd-file:"../../../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->

View file

@ -0,0 +1,48 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 1.1 $ -->
<refentry xml:id="mongocursor.doquery" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>MongoCursor::doQuery</refname>
<refpurpose>Execute the query.</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<modifier>protected</modifier> <type>void</type><methodname>MongoCursor::doQuery</methodname>
<void/>
</methodsynopsis>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
&no.function.parameters;
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
&null;.
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
sgml-parent-document:nil
sgml-default-dtd-file:"../../../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->

View file

@ -0,0 +1,48 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 1.1 $ -->
<refentry xml:id="mongocursor.getnext" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>MongoCursor::getNext</refname>
<refpurpose>Return the next object to which this cursor points, and advance the cursor</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<modifier>public</modifier> <type>array</type><methodname>MongoCursor::getNext</methodname>
<void/>
</methodsynopsis>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
&no.function.parameters;
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Returns the next object.
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
sgml-parent-document:nil
sgml-default-dtd-file:"../../../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->

View file

@ -0,0 +1,48 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 1.1 $ -->
<refentry xml:id="mongocursor.hasnext" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>MongoCursor::hasNext</refname>
<refpurpose>Checks if there are any more elements in this cursor</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<modifier>public</modifier> <type>boolean</type><methodname>MongoCursor::hasNext</methodname>
<void/>
</methodsynopsis>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
&no.function.parameters;
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Returns if there is another element.
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
sgml-parent-document:nil
sgml-default-dtd-file:"../../../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->

View file

@ -0,0 +1,68 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 1.1 $ -->
<refentry xml:id="mongocursor.hint" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>MongoCursor::hint</refname>
<refpurpose>Gives the database a hint about the query</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<modifier>public</modifier> <type>MongoCursor</type><methodname>MongoCursor::hint</methodname>
<methodparam><type>array</type><parameter>key_pattern</parameter></methodparam>
</methodsynopsis>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term>
<parameter>key_pattern</parameter>
</term>
<listitem>
<para>
Indexes to use for the query.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Returns this cursor.
</para>
</refsect1>
<refsect1 role="errors">
&reftitle.errors;
<para>
Throws MongoCursorException if this cursor has started iterating.
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
sgml-parent-document:nil
sgml-default-dtd-file:"../../../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->

View file

@ -0,0 +1,69 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 1.1 $ -->
<refentry xml:id="mongocursor.limit" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>MongoCursor::limit</refname>
<refpurpose>Limits the number of results returned</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<modifier>public</modifier> <type>MongoCursor</type><methodname>MongoCursor::limit</methodname>
<methodparam><type>int</type><parameter>num</parameter></methodparam>
</methodsynopsis>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term>
<parameter>num</parameter>
</term>
<listitem>
<para>
The number of results to return.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Returns this cursor.
</para>
</refsect1>
<refsect1 role="errors">
&reftitle.errors;
<para>
Throws MongoCursorException if this cursor has started iterating.
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
sgml-parent-document:nil
sgml-default-dtd-file:"../../../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->

View file

@ -0,0 +1,48 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 1.1 $ -->
<refentry xml:id="mongocursor.next" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>MongoCursor::next</refname>
<refpurpose>Advances the cursor to the next result</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<modifier>public</modifier> <type>void</type><methodname>MongoCursor::next</methodname>
<void/>
</methodsynopsis>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
&no.function.parameters;
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
&null;.
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
sgml-parent-document:nil
sgml-default-dtd-file:"../../../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->

View file

@ -0,0 +1,48 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 1.1 $ -->
<refentry xml:id="mongocursor.reset" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>MongoCursor::reset</refname>
<refpurpose>Clears the cursor</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<modifier>public</modifier> <type>void</type><methodname>MongoCursor::reset</methodname>
<void/>
</methodsynopsis>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
&no.function.parameters;
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
&null;.
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
sgml-parent-document:nil
sgml-default-dtd-file:"../../../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->

View file

@ -0,0 +1,48 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 1.1 $ -->
<refentry xml:id="mongocursor.rewind" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>MongoCursor::rewind</refname>
<refpurpose>Returns the cursor to the beginning of the result set</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<modifier>public</modifier> <type>void</type><methodname>MongoCursor::rewind</methodname>
<void/>
</methodsynopsis>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
&no.function.parameters;
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
&null;.
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
sgml-parent-document:nil
sgml-default-dtd-file:"../../../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->

View file

@ -0,0 +1,69 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 1.1 $ -->
<refentry xml:id="mongocursor.skip" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>MongoCursor::skip</refname>
<refpurpose>Skips a number of results</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<modifier>public</modifier> <type>MongoCursor</type><methodname>MongoCursor::skip</methodname>
<methodparam><type>int</type><parameter>num</parameter></methodparam>
</methodsynopsis>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term>
<parameter>num</parameter>
</term>
<listitem>
<para>
The number of results to skip.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Returns this cursor.
</para>
</refsect1>
<refsect1 role="errors">
&reftitle.errors;
<para>
Throws MongoCursorException if this cursor has started iterating.
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
sgml-parent-document:nil
sgml-default-dtd-file:"../../../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->

View file

@ -0,0 +1,89 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 1.1 $ -->
<refentry xml:id="mongocursor.softlimit" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>MongoCursor::softLimit</refname>
<refpurpose>Limits the number of results initially returned</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<modifier>public</modifier> <type>MongoCursor</type><methodname>MongoCursor::softLimit</methodname>
<methodparam><type>int</type><parameter>num</parameter></methodparam>
</methodsynopsis>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term>
<parameter>num</parameter>
</term>
<listitem>
<para>
The number of results to return.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Returns this cursor.
</para>
</refsect1>
<refsect1 role="errors">
&reftitle.errors;
<para>
Throws MongoCursorException if this cursor has started iterating.
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<example>
<title><function>MongoCursor::softLimit</function> and <function>MongoCursor::limit</function> example</title>
<para>
<literal>limit()</literal> and <literal>softLimit()</literal> are mutually exclusive, and whichever one comes last will &quot;win&quot;:
</para>
<programlisting role="php">
<![CDATA[
<?php
// 20 returned
$cursor1 = $collection->find()->softLimit(10)->limit(20);
// all documents returned, 10 sent to the client on initial request
$cursor2 = $collection->find()->limit(20)->softLimit(10);
?>
]]>
</programlisting>
</example>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
sgml-parent-document:nil
sgml-default-dtd-file:"../../../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->

View file

@ -0,0 +1,93 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 1.1 $ -->
<refentry xml:id="mongocursor.sort" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>MongoCursor::sort</refname>
<refpurpose>Sorts the results by given fields</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<modifier>public</modifier> <type>MongoCursor</type><methodname>MongoCursor::sort</methodname>
<methodparam><type>array</type><parameter>fields</parameter></methodparam>
</methodsynopsis>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term>
<parameter>fields</parameter>
</term>
<listitem>
<para>
The fields by which to sort.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Returns this cursor.
</para>
</refsect1>
<refsect1 role="errors">
&reftitle.errors;
<para>
Throws MongoCursorException if this cursor has started iterating.
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<example>
<title><function>MongoCursor::sort</function> example</title>
<programlisting role="php">
<![CDATA[
<?php
// sort x ascending
$cursor->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));
?>
]]>
</programlisting>
</example>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
sgml-parent-document:nil
sgml-default-dtd-file:"../../../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->

View file

@ -0,0 +1,48 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 1.1 $ -->
<refentry xml:id="mongocursor.valid" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>MongoCursor::valid</refname>
<refpurpose>Checks if the cursor is reading a valid result.</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<modifier>public</modifier> <type>boolean</type><methodname>MongoCursor::valid</methodname>
<void/>
</methodsynopsis>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
&no.function.parameters;
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
If the current result is not null.
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
sgml-parent-document:nil
sgml-default-dtd-file:"../../../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->

View file

@ -0,0 +1,83 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 1.1 $ -->
<phpdoc:classref xml:id="class.mongodb" xmlns:phpdoc="http://php.net/ns/phpdoc" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xi="http://www.w3.org/2001/XInclude">
<title>The MongoDB class</title>
<titleabbrev>MongoDB</titleabbrev>
<partintro>
<!-- {{{ Mongodb intro -->
<section xml:id="mongodb.intro">
&reftitle.intro;
<para>
Instances of this class are used to interact with a database. To get a
database:
<![CDATA[
<?php
$m = new Mongo(); // connect
$db = $m->selectDB("example");
?>
]]>
Database names can use almost any character in the ASCII range. However,
they cannot contain &quot; &quot;, &quot;.&quot; or be the empty string.
</para>
<para>
A few unusual, but valid, database names: &quot;null&quot;, &quot;[x,y]&quot;, &quot;3&quot;, &quot;\&quot;&quot;, &quot;/&quot;.
</para>
<para>
Unlike collection names, database names may contain &quot;$&quot;.
</para>
</section>
<!-- }}} -->
<section xml:id="mongodb.synopsis">
&reftitle.classsynopsis;
<!-- {{{ Synopsis -->
<classsynopsis>
<ooclass><classname>MongoDB</classname></ooclass>
<!-- {{{ Class synopsis -->
<classsynopsisinfo>
<ooclass>
<classname>MongoDB</classname>
</ooclass>
</classsynopsisinfo>
<!-- }}} -->
<classsynopsisinfo role="comment">Methods</classsynopsisinfo>
<xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('class.mongodb')/db:refentry/db:refsect1[@role='description']/descendant::db:methodsynopsis[1])" />
</classsynopsis>
<!-- }}} -->
</section>
</partintro>
&reference.mongo.entities.mongodb;
</phpdoc:classref>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->

View file

@ -0,0 +1,81 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 1.1 $ -->
<refentry xml:id="mongodb.construct" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>MongoDB::__construct</refname>
<refpurpose>Creates a new database</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<methodname>MongoDB::__construct</methodname>
<methodparam><type>Mongo</type><parameter>conn</parameter></methodparam>
<methodparam><type>string</type><parameter>name</parameter></methodparam>
</methodsynopsis>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term>
<type>Mongo</type>
<parameter>conn</parameter>
</term>
<listitem>
<para>
Database connection.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<parameter>name</parameter>
</term>
<listitem>
<para>
Database name.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Returns the database.
</para>
</refsect1>
<refsect1 role="errors">
&reftitle.errors;
<para>
Throws InvalidArgumentException if the database name is invalid.
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
sgml-parent-document:nil
sgml-default-dtd-file:"../../../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->

View file

@ -0,0 +1,91 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 1.1 $ -->
<refentry xml:id="mongodb.createcollection" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>MongoDB::createCollection</refname>
<refpurpose>Creates a collection</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<modifier>public</modifier> <type>MongoCollection</type><methodname>MongoDB::createCollection</methodname>
<methodparam><type>string</type><parameter>name</parameter></methodparam>
<methodparam choice="opt"><type>bool</type><parameter>capped</parameter><initializer>&false;</initializer></methodparam>
<methodparam choice="opt"><type>int</type><parameter>size</parameter><initializer>0</initializer></methodparam>
<methodparam choice="opt"><type>int</type><parameter>max</parameter><initializer>0</initializer></methodparam>
</methodsynopsis>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term>
<parameter>name</parameter>
</term>
<listitem>
<para>
The name of the collection.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<parameter>capped</parameter>
</term>
<listitem>
<para>
If the collection should be a fixed size.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<parameter>size</parameter>
</term>
<listitem>
<para>
If the collection is fixed size, its size in bytes.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<parameter>max</parameter>
</term>
<listitem>
<para>
If the collection is fixed size, the maximum number of elements to store in the collection.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Returns a collection object representing the new collection.
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
sgml-parent-document:nil
sgml-default-dtd-file:"../../../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->

View file

@ -0,0 +1,72 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 1.1 $ -->
<refentry xml:id="mongodb.createdbref" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>MongoDB::createDBRef</refname>
<refpurpose>Creates a database reference</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<modifier>public</modifier> <type>array</type><methodname>MongoDB::createDBRef</methodname>
<methodparam><type>mixed</type><parameter>ns</parameter></methodparam>
<methodparam><type>mixed</type><parameter>a</parameter></methodparam>
</methodsynopsis>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term>
<parameter>ns</parameter>
</term>
<listitem>
<para>
The collection to which the database reference will point.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<parameter>a</parameter>
</term>
<listitem>
<para>
Object or _id to which to create a reference.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Returns a database reference array.
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
sgml-parent-document:nil
sgml-default-dtd-file:"../../../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->

View file

@ -0,0 +1,48 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 1.1 $ -->
<refentry xml:id="mongodb.drop" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>MongoDB::drop</refname>
<refpurpose>Drops this database</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<modifier>public</modifier> <type>array</type><methodname>MongoDB::drop</methodname>
<void/>
</methodsynopsis>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
&no.function.parameters;
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Returns the database response.
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
sgml-parent-document:nil
sgml-default-dtd-file:"../../../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->

View file

@ -0,0 +1,58 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 1.1 $ -->
<refentry xml:id="mongodb.dropcollection" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>MongoDB::dropCollection</refname>
<refpurpose>Drops a collection</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<modifier>public</modifier> <type>array</type><methodname>MongoDB::dropCollection</methodname>
<methodparam><type>mixed</type><parameter>coll</parameter></methodparam>
</methodsynopsis>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term>
<parameter>coll</parameter>
</term>
<listitem>
<para>
MongoCollection or name of collection to drop.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Returns the database response.
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
sgml-parent-document:nil
sgml-default-dtd-file:"../../../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->

View file

@ -0,0 +1,72 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 1.1 $ -->
<refentry xml:id="mongodb.execute" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>MongoDB::execute</refname>
<refpurpose>Runs JavaScript code on the database server.</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<modifier>public</modifier> <type>array</type><methodname>MongoDB::execute</methodname>
<methodparam><type>mixed</type><parameter>code</parameter></methodparam>
<methodparam choice="opt"><type>array</type><parameter>args</parameter><initializer>array()</initializer></methodparam>
</methodsynopsis>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term>
<parameter>code</parameter>
</term>
<listitem>
<para>
MongoCode or string to execute.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<parameter>args</parameter>
</term>
<listitem>
<para>
Arguments to be passed to <literal>code</literal>.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Returns the result of the evaluation.
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
sgml-parent-document:nil
sgml-default-dtd-file:"../../../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->

View file

@ -0,0 +1,45 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 1.1 $ -->
<refentry xml:id="mongodb.getcursorinfo" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>MongoDB::getCursorInfo</refname>
<refpurpose>Gets information from the database about cursors</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<modifier>public</modifier> <type>array</type><methodname>MongoDB::getCursorInfo</methodname>
<void/>
</methodsynopsis>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
&no.function.parameters;
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Returns the database response.
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
sgml-parent-document:nil
sgml-default-dtd-file:"../../../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->

View file

@ -0,0 +1,61 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 1.1 $ -->
<refentry xml:id="mongodb.getdbref" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>MongoDB::getDBRef</refname>
<refpurpose>Fetches a database reference</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<modifier>public</modifier> <type>array</type><methodname>MongoDB::getDBRef</methodname>
<methodparam><type>array</type><parameter>ref</parameter></methodparam>
</methodsynopsis>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term>
<parameter>ref</parameter>
</term>
<listitem>
<para>
A database reference.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Returns the database document pointed to by the reference.
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
sgml-parent-document:nil
sgml-default-dtd-file:"../../../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->

View file

@ -0,0 +1,73 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 1.1 $ -->
<refentry xml:id="mongodb.getgridfs" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>MongoDB::getGridFS</refname>
<refpurpose>Fetches toolkit for dealing with files stored in this database</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<modifier>public</modifier> <type>MongoGridFS</type><methodname>MongoDB::getGridFS</methodname>
<methodparam choice="opt"><type>string</type><parameter>arg1</parameter><initializer>&quot;fs&quot;</initializer></methodparam>
<methodparam choice="opt"><type>string</type><parameter>arg2</parameter><initializer>&null;</initializer></methodparam>
</methodsynopsis>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term>
<parameter>arg1</parameter>
</term>
<listitem>
<para>
If the only argument, the prefix for the files and chunks collections. Otherwise,
the name of the files collection.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<parameter>arg2</parameter>
</term>
<listitem>
<para>
Name of the chunks collection.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Returns a new gridfs object for this database.
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
sgml-parent-document:nil
sgml-default-dtd-file:"../../../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->

View file

@ -0,0 +1,48 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 1.1 $ -->
<refentry xml:id="mongodb.getprofilinglevel" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>MongoDB::getProfilingLevel</refname>
<refpurpose>Gets this database&apos;s profiling level</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<modifier>public</modifier> <type>int</type><methodname>MongoDB::getProfilingLevel</methodname>
<void/>
</methodsynopsis>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
&no.function.parameters;
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Returns the profiling level.
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
sgml-parent-document:nil
sgml-default-dtd-file:"../../../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->

View file

@ -0,0 +1,45 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 1.1 $ -->
<refentry xml:id="mongodb.listcollections" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>MongoDB::listCollections</refname>
<refpurpose>Get a list of collections in this database</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<modifier>public</modifier> <type>array</type><methodname>MongoDB::listCollections</methodname>
<void/>
</methodsynopsis>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
&no.function.parameters;
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Returns a list of collection names.
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
sgml-parent-document:nil
sgml-default-dtd-file:"../../../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->

View file

@ -0,0 +1,72 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 1.1 $ -->
<refentry xml:id="mongodb.repair" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>MongoDB::repair</refname>
<refpurpose>Repairs and compacts this database</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<modifier>public</modifier> <type>array</type><methodname>MongoDB::repair</methodname>
<methodparam choice="opt"><type>bool</type><parameter>preserve_cloned_files</parameter><initializer>&false;</initializer></methodparam>
<methodparam choice="opt"><type>bool</type><parameter>backup_original_files</parameter><initializer>&false;</initializer></methodparam>
</methodsynopsis>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term>
<parameter>preserve_cloned_files</parameter>
</term>
<listitem>
<para>
If cloned files should be kept if the repair fails.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<parameter>backup_original_files</parameter>
</term>
<listitem>
<para>
If original files should be backed up.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Returns db response.
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
sgml-parent-document:nil
sgml-default-dtd-file:"../../../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->

View file

@ -0,0 +1,58 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 1.1 $ -->
<refentry xml:id="mongodb.selectcollection" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>MongoDB::selectCollection</refname>
<refpurpose>Gets a collection</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<modifier>public</modifier> <type>MongoCollection</type><methodname>MongoDB::selectCollection</methodname>
<methodparam><type>string</type><parameter>name</parameter></methodparam>
</methodsynopsis>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term>
<parameter>name</parameter>
</term>
<listitem>
<para>
The name of the collection.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Returns the collection.
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
sgml-parent-document:nil
sgml-default-dtd-file:"../../../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->

View file

@ -0,0 +1,61 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 1.1 $ -->
<refentry xml:id="mongodb.setprofilinglevel" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>MongoDB::setProfilingLevel</refname>
<refpurpose>Sets this database&apos;s profiling level</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<modifier>public</modifier> <type>int</type><methodname>MongoDB::setProfilingLevel</methodname>
<methodparam><type>int</type><parameter>level</parameter></methodparam>
</methodsynopsis>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term>
<parameter>level</parameter>
</term>
<listitem>
<para>
Profiling level.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Returns the previous profiling level.
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
sgml-parent-document:nil
sgml-default-dtd-file:"../../../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->

View file

@ -0,0 +1,48 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 1.1 $ -->
<refentry xml:id="mongodb.--tostring" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>MongoDB::__toString</refname>
<refpurpose>The name of this database</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<modifier>public</modifier> <type>string</type><methodname>MongoDB::__toString</methodname>
<void />
</methodsynopsis>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
&no.function.parameters;
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Returns this database&apos;s name.
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
sgml-parent-document:nil
sgml-default-dtd-file:"../../../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->

View file

@ -0,0 +1,68 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 1.1 $ -->
<phpdoc:classref xml:id="class.mongogridfs" xmlns:phpdoc="http://php.net/ns/phpdoc" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xi="http://www.w3.org/2001/XInclude">
<title>The MongoGridFS class</title>
<titleabbrev>MongoGridFS</titleabbrev>
<partintro>
<!-- {{{ Mongogridfs intro -->
<section xml:id="mongogridfs.intro">
&reftitle.intro;
<para>
Utilities for storing and retreiving files from the database.
</para>
</section>
<!-- }}} -->
<section xml:id="mongogridfs.synopsis">
&reftitle.classsynopsis;
<!-- {{{ Synopsis -->
<classsynopsis>
<ooclass><classname>MongoGridFS</classname></ooclass>
<!-- {{{ Class synopsis -->
<classsynopsisinfo>
<ooclass>
<modifier>extends</modifier>
<classname>MongoCollection</classname>
</ooclass>
</classsynopsisinfo>
<!-- }}} -->
<classsynopsisinfo role="comment">Methods</classsynopsisinfo>
<xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('class.mongogridfs')/db:refentry/db:refsect1[@role='description']/descendant::db:methodsynopsis[1])" />
</classsynopsis>
<!-- }}} -->
</section>
</partintro>
&reference.mongo.entities.mongogridfs;
</phpdoc:classref>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->

View file

@ -0,0 +1,96 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 1.1 $ -->
<refentry xml:id="mongogridfs.--construct" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>MongoGridFS::__construct</refname>
<refpurpose>Creates new file collections</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<methodname>MongoGridFS::__construct</methodname>
<methodparam><type>MongoDB</type><parameter>db</parameter></methodparam>
<methodparam choice="opt"><type>string</type><parameter>files</parameter><initializer>&null;</initializer></methodparam>
<methodparam choice="opt"><type>string</type><parameter>chunks</parameter><initializer>&null;</initializer></methodparam>
</methodsynopsis>
<para>
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.
</para>
<para>
Use one argument to specify a prefix other than "fs":
<![CDATA[
$fs = new MongoGridFS($db, "myfiles");
]]>
uses myfiles.files and myfiles.chunks collections.
</para>
<para>
Use two arguments to fully specify the collection names:
<![CDATA[
$fs = new MongoGridFS($db, "myfiles", "mychunks");
]]>
uses myfiles and mychunks collections.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term>
<parameter>db</parameter>
</term>
<listitem>
<para>
Database.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<parameter>files</parameter>
</term>
<listitem>
<para>
Optional files collection name. If chunks is not given,
<literal>files</literal> is used as both collections&apos; prefix.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<parameter>chunks</parameter>
</term>
<listitem>
<para>
Optional chunks collection name.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
sgml-parent-document:nil
sgml-default-dtd-file:"../../../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->

View file

@ -0,0 +1,49 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 1.1 $ -->
<refentry xml:id="mongogridfs.drop" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>MongoGridFS::drop</refname>
<refpurpose>Drops the files and chunks collections</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<modifier>public</modifier> <type>array</type><methodname>MongoGridFS::drop</methodname>
<void/>
</methodsynopsis>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
&no.function.parameters;
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
The database response.
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
sgml-parent-document:nil
sgml-default-dtd-file:"../../../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->

View file

@ -0,0 +1,73 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 1.1 $ -->
<refentry xml:id="mongogridfs.find" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>MongoGridFS::find</refname>
<refpurpose>Queries for files</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<modifier>public</modifier> <type>MongoGridFSCursor</type><methodname>MongoGridFS::find</methodname>
<methodparam choice="opt"><type>array</type><parameter>query</parameter><initializer>array()</initializer></methodparam>
<methodparam choice="opt"><type>array</type><parameter>fields</parameter><initializer>array()</initializer></methodparam>
</methodsynopsis>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term>
<parameter>query</parameter>
</term>
<listitem>
<para>
The query.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<parameter>fields</parameter>
</term>
<listitem>
<para>
Fields to return.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
A file cursor to the results.
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
sgml-parent-document:nil
sgml-default-dtd-file:"../../../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->

View file

@ -0,0 +1,62 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 1.1 $ -->
<refentry xml:id="mongogridfs.findone" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>MongoGridFS::findOne</refname>
<refpurpose>Returns a single file matching the criteria</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<modifier>public</modifier> <type>MongoGridFSFile</type><methodname>MongoGridFS::findOne</methodname>
<methodparam choice="opt"><type>mixed</type><parameter>query</parameter><initializer>array()</initializer></methodparam>
</methodsynopsis>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term>
<parameter>query</parameter>
</term>
<listitem>
<para>
The filename or criteria for which to search.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Returns a file or &null;.
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
sgml-parent-document:nil
sgml-default-dtd-file:"../../../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->

View file

@ -0,0 +1,73 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 1.1 $ -->
<refentry xml:id="mongogridfs.remove" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>MongoGridFS::remove</refname>
<refpurpose>Removes files from the collections</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<modifier>public</modifier> <type>boolean</type><methodname>MongoGridFS::remove</methodname>
<methodparam choice="opt"><type>array</type><parameter>criteria</parameter><initializer>array()</initializer></methodparam>
<methodparam choice="opt"><type>boolean</type><parameter>just_one</parameter><initializer>&false;</initializer></methodparam>
</methodsynopsis>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term>
<parameter>query</parameter>
</term>
<listitem>
<para>
The filename or criteria for which to search.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<parameter>just_one</parameter>
</term>
<listitem>
<para>
If only one matching file should be removed.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Returns if the removal was successful.
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
sgml-parent-document:nil
sgml-default-dtd-file:"../../../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->

View file

@ -0,0 +1,73 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 1.1 $ -->
<refentry xml:id="mongogridfs.storefile" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>MongoGridFS::storeFile</refname>
<refpurpose>Stores a file in the database</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<modifier>public</modifier> <type>MongoId</type><methodname>MongoGridFS::storeFile</methodname>
<methodparam><type>string</type><parameter>filename</parameter></methodparam>
<methodparam choice="opt"><type>array</type><parameter>extra</parameter><initializer>array()</initializer></methodparam>
</methodsynopsis>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term>
<parameter>filename</parameter>
</term>
<listitem>
<para>
The name of the file.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<parameter>extra</parameter>
</term>
<listitem>
<para>
Other metadata to add to the file saved.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Returns the database id for the file.
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
sgml-parent-document:nil
sgml-default-dtd-file:"../../../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->

View file

@ -0,0 +1,72 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 1.1 $ -->
<refentry xml:id="mongogridfs.saveupload" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>MongoGridFS::storeUpload</refname>
<refpurpose>Saves an uploaded file to the database</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<modifier>public</modifier> <type>MongoId</type><methodname>MongoGridFS::storeUpload</methodname>
<methodparam><type>string</type><parameter>name</parameter></methodparam>
<methodparam choice="opt"><type>array</type><parameter>extra</parameter></methodparam>
</methodsynopsis>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term>
<parameter>name</parameter>
</term>
<listitem>
<para>
The name field of the uploaded file.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<parameter>extra</parameter>
</term>
<listitem>
<para>
Other metadata to add to the file saved.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Returns the id of the uploaded file.
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
sgml-parent-document:nil
sgml-default-dtd-file:"../../../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->

View file

@ -0,0 +1,67 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 1.1 $ -->
<phpdoc:classref xml:id="class.mongogridfsfile" xmlns:phpdoc="http://php.net/ns/phpdoc" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xi="http://www.w3.org/2001/XInclude">
<title>The MongoGridFSFile class</title>
<titleabbrev>MongoGridFSFile</titleabbrev>
<partintro>
<!-- {{{ MongoGridfsFile intro -->
<section xml:id="mongogridfsfile.intro">
&reftitle.intro;
<para>
A database file object.
</para>
</section>
<!-- }}} -->
<section xml:id="mongogridfsfile.synopsis">
&reftitle.classsynopsis;
<!-- {{{ Synopsis -->
<classsynopsis>
<ooclass><classname>MongoGridFSFile</classname></ooclass>
<!-- {{{ Class synopsis -->
<classsynopsisinfo>
<ooclass>
<classname>MongoGridFSFile</classname>
</ooclass>
</classsynopsisinfo>
<!-- }}} -->
<classsynopsisinfo role="comment">Methods</classsynopsisinfo>
<xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('class.mongogridfsfile')/db:refentry/db:refsect1[@role='description']/descendant::db:methodsynopsis[1])" />
</classsynopsis>
<!-- }}} -->
</section>
</partintro>
&reference.mongo.entities.mongogridfsfile;
</phpdoc:classref>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->

View file

@ -0,0 +1,71 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 1.1 $ -->
<refentry xml:id="mongogridfsfile.construct" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>MongoGridfsFile::__construct</refname>
<refpurpose>Create a new GridFS file</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<methodname>MongoGridfsFile::__construct</methodname>
<methodparam><type>MongoGridFS</type><parameter>gridfs</parameter></methodparam>
<methodparam><type>array</type><parameter>file</parameter></methodparam>
</methodsynopsis>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term>
<parameter>gridfs</parameter>
</term>
<listitem>
<para>
The parent MongoGridFS instance.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<parameter>file</parameter>
</term>
<listitem>
<para>
A file from the database.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Returns a new MongoGridFSFile.
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
sgml-parent-document:nil
sgml-default-dtd-file:"../../../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->

View file

@ -0,0 +1,52 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 1.1 $ -->
<refentry xml:id="mongogridfsfile.getbytes" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>MongoGridFSFile::getBytes</refname>
<refpurpose>Returns this file&apos;s contents as a string of bytes</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<modifier>public</modifier> <type>string</type><methodname>MongoGridFSFile::getBytes</methodname>
<void/>
</methodsynopsis>
<para>
Warning: this will load the file into memory. If the file is bigger than
your memory, this will cause problems!
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
&no.function.parameters;
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Returns a string of the bytes in the file.
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
sgml-parent-document:nil
sgml-default-dtd-file:"../../../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->

View file

@ -0,0 +1,45 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 1.1 $ -->
<refentry xml:id="mongogridfsfile.getfilename" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>MongoGridfsFile::getFilename</refname>
<refpurpose>Returns this file&apos;s filename</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<modifier>public</modifier> <type>string</type><methodname>MongoGridfsFile::getFilename</methodname>
<void/>
</methodsynopsis>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
&no.function.parameters;
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Returns the filename.
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
sgml-parent-document:nil
sgml-default-dtd-file:"../../../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->

View file

@ -0,0 +1,45 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 1.1 $ -->
<refentry xml:id="mongogridfsfile.getsize" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>MongoGridfsFile::getSize</refname>
<refpurpose>Returns this file&apos;s size</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<modifier>public</modifier> <type>int</type><methodname>MongoGridfsFile::getSize</methodname>
<void/>
</methodsynopsis>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
&no.function.parameters;
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Returns this file's size
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
sgml-parent-document:nil
sgml-default-dtd-file:"../../../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->

View file

@ -0,0 +1,59 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 1.1 $ -->
<refentry xml:id="mongogridfsfile.write" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>MongoGridFSFile::write</refname>
<refpurpose>Writes this file to the filesystem</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<modifier>public</modifier> <type>int</type><methodname>MongoGridFSFile::write</methodname>
<methodparam choice="opt"><type>string</type><parameter>filename</parameter><initializer>&null;</initializer></methodparam>
</methodsynopsis>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term>
<parameter>filename</parameter>
</term>
<listitem>
<para>
The location to which to write the file. If none is given,
the stored filename will be used.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Returns the number of bytes written.
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
sgml-parent-document:nil
sgml-default-dtd-file:"../../../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->

View file

@ -0,0 +1,67 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 1.1 $ -->
<phpdoc:classref xml:id="class.mongoutil" xmlns:phpdoc="http://php.net/ns/phpdoc" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xi="http://www.w3.org/2001/XInclude">
<title>The MongoUtil class</title>
<titleabbrev>MongoUtil</titleabbrev>
<partintro>
<!-- {{{ Mongoutil intro -->
<section xml:id="mongoutil.intro">
&reftitle.intro;
<para>
Some handy functions used by the other classes.
</para>
</section>
<!-- }}} -->
<section xml:id="mongoutil.synopsis">
&reftitle.classsynopsis;
<!-- {{{ Synopsis -->
<classsynopsis>
<ooclass><classname>MongoUtil</classname></ooclass>
<!-- {{{ Class synopsis -->
<classsynopsisinfo>
<ooclass>
<classname>MongoUtil</classname>
</ooclass>
</classsynopsisinfo>
<!-- }}} -->
<classsynopsisinfo role="comment">Methods</classsynopsisinfo>
<xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('class.mongoutil')/db:refentry/db:refsect1[@role='description']/descendant::db:methodsynopsis[1])" />
</classsynopsis>
<!-- }}} -->
</section>
</partintro>
&reference.mongo.entities.mongoutil;
</phpdoc:classref>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->

View file

@ -0,0 +1,81 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 1.1 $ -->
<refentry xml:id="mongoutil.dbcommand" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>MongoUtil::dbCommand</refname>
<refpurpose>Execute a db command</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<modifier>public</modifier> <modifier>static</modifier> <type>array</type><methodname>MongoUtil::dbCommand</methodname>
<methodparam><type>resource</type><parameter>conn</parameter></methodparam>
<methodparam><type>array</type><parameter>data</parameter></methodparam>
<methodparam><type>string</type><parameter>db</parameter></methodparam>
</methodsynopsis>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term>
<type>resource</type>
<parameter>conn</parameter>
</term>
<listitem>
<para>
Database connection.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<parameter>data</parameter>
</term>
<listitem>
<para>
The query to send.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<parameter>db</parameter>
</term>
<listitem>
<para>
The database name.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Returns database response.
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
sgml-parent-document:nil
sgml-default-dtd-file:"../../../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->

View file

@ -0,0 +1,58 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 1.1 $ -->
<refentry xml:id="mongoutil.toindexstring" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>MongoUtil::toIndexString</refname>
<refpurpose>Converts a field or array of fields into an underscore-separated string</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<modifier>public</modifier> <modifier>static</modifier> <type>string</type><methodname>MongoUtil::toIndexString</methodname>
<methodparam><type>string|array</type><parameter>keys</parameter></methodparam>
</methodsynopsis>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term>
<parameter>keys</parameter>
</term>
<listitem>
<para>
Field(s) to convert.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Returns the index name.
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
sgml-parent-document:nil
sgml-default-dtd-file:"../../../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->

View file

@ -1,24 +1,96 @@
<?xml version='1.0' encoding='utf-8'?>
<!-- $Revision: 1.4 $ -->
<!-- $Revision: 1.5 $ -->
<!--
Do NOT translate this file
-->
<versions>
<!-- Functions -->
<function name='mongo_connect' from='PECL mongo &gt;= 0.8.0'/>
<function name='mongo_close' from='PECL mongo &gt;= 0.8.0'/>
<function name='mongo_remove' from='PECL mongo &gt;= 0.8.0'/>
<function name='mongo_query' from='PECL mongo &gt;= 0.8.0'/>
<function name='mongo_find_one' from='PECL mongo &gt;= 0.8.0'/>
<function name='mongo_insert' from='PECL mongo &gt;= 0.8.0'/>
<function name='mongo_update' from='PECL mongo &gt;= 0.8.0'/>
<function name='mongo_has_next' from='PECL mongo &gt;= 0.8.0'/>
<function name='mongo_next' from='PECL mongo &gt;= 0.8.0'/>
<function name='mongo_gridfs_init' from='PECL mongo &gt;= 0.8.0'/>
<function name='mongo_gridfs_store' from='PECL mongo &gt;= 0.8.0'/>
<function name='mongo_gridfile_write' from='PECL mongo &gt;= 0.8.0'/>
<!-- Methods -->
<!-- Mongo -->
<function name='mongo::__construct' from='PECL mongo &gt;=0.9.0'/>
<function name='mongo::__tostring' from='PECL mongo &gt;=0.9.0'/>
<function name='mongo::connect' from='PECL mongo &gt;=0.9.0'/>
<function name='mongo::pairConnect' from='PECL mongo &gt;=0.9.0'/>
<function name='mongo::persistConnect' from='PECL mongo &gt;=0.9.0'/>
<function name='mongo::pairPersistConnect' from='PECL mongo &gt;=0.9.0'/>
<function name='mongo::connectUtil' from='PECL mongo &gt;=0.9.0'/>
<function name='mongo::close' from='PECL mongo &gt;=0.9.0'/>
<function name='mongo::dropdb' from='PECL mongo &gt;=0.9.0'/>
<function name='mongo::getauth' from='PECL mongo &gt;=0.9.0'/>
<function name='mongo::lasterror' from='PECL mongo &gt;=0.9.0'/>
<function name='mongo::preverror' from='PECL mongo &gt;=0.9.0'/>
<function name='mongo::forceerror' from='PECL mongo &gt;=0.8.1'/>
<function name='mongo::reseterror' from='PECL mongo &gt;=0.9.0'/>
<function name='mongo::repairdb' from='PECL mongo &gt;=0.9.0'/>
<function name='mongo::selectdb' from='PECL mongo &gt;=0.9.0'/>
<function name='mongo::selectcollection' from='PECL mongo &gt;=0.9.0'/>
<!-- MongoDB -->
<function name='mongodb::__construct' from='PECL mongo &gt;=0.9.0'/>
<function name='mongodb::__tostring' from='PECL mongo &gt;=0.9.0'/>
<function name='mongodb::createcollection' from='PECL mongo &gt;=0.9.0'/>
<function name='mongodb::drop' from='PECL mongo &gt;=0.9.0'/>
<function name='mongodb::dropcollection' from='PECL mongo &gt;=0.9.0'/>
<function name='mongodb::getauth' from='PECL mongo &gt;=0.9.0'/>
<function name='mongodb::getgridfs' from='PECL mongo &gt;=0.9.0'/>
<function name='mongodb::getname' from='PECL mongo &gt;=0.9.0'/>
<function name='mongodb::getprofilinglevel' from='PECL mongo &gt;=0.9.0'/>
<function name='mongodb::listcollections' from='PECL mongo &gt;=0.9.0'/>
<function name='mongodb::repair' from='PECL mongo &gt;=0.9.0'/>
<function name='mongodb::selectcollection' from='PECL mongo &gt;=0.9.0'/>
<function name='mongodb::setprofilinglevel' from='PECL mongo &gt;=0.9.0'/>
<function name='mongodb::createdbref' from='PECL mongo &gt;=0.9.0'/>
<function name='mongodb::getdbref' from='PECL mongo &gt;=0.9.0'/>
<!-- MongoCollection -->
<function name='mongocollection::__construct' from='PECL mongo &gt;=0.9.0'/>
<function name='mongocollection::__tostring' from='PECL mongo &gt;=0.9.0'/>
<function name='mongocollection::getname' from='PECL mongo &gt;=0.9.0'/>
<function name='mongocollection::count' from='PECL mongo &gt;=0.9.0'/>
<function name='mongocollection::deleteindex' from='PECL mongo &gt;=0.9.0'/>
<function name='mongocollection::deleteindexes' from='PECL mongo &gt;=0.9.0'/>
<function name='mongocollection::drop' from='PECL mongo &gt;=0.9.0'/>
<function name='mongocollection::ensureindex' from='PECL mongo &gt;=0.9.0'/>
<function name='mongocollection::find' from='PECL mongo &gt;=0.9.0'/>
<function name='mongocollection::findone' from='PECL mongo &gt;=0.9.0'/>
<function name='mongocollection::getindexinfo' from='PECL mongo &gt;=0.9.0'/>
<function name='mongocollection::insert' from='PECL mongo &gt;=0.9.0'/>
<function name='mongocollection::batchinsert' from='PECL mongo &gt;=0.9.0'/>
<function name='mongocollection::remove' from='PECL mongo &gt;=0.9.0'/>
<function name='mongocollection::save' from='PECL mongo &gt;=0.9.0'/>
<function name='mongocollection::update' from='PECL mongo &gt;=0.9.0'/>
<function name='mongocollection::validate' from='PECL mongo &gt;=0.9.0'/>
<function name='mongocollection::createdbref' from='PECL mongo &gt;=0.9.0'/>
<function name='mongocollection::getdbref' from='PECL mongo &gt;=0.9.0'/>
<!-- MongoCursor -->
<function name='mongocursor::__construct' from='PECL mongo &gt;=0.9.0'/>
<function name='mongocursor::hasnext' from='PECL mongo &gt;=0.9.0'/>
<function name='mongocursor::getnext' from='PECL mongo &gt;=0.9.0'/>
<function name='mongocursor::hint' from='PECL mongo &gt;=0.9.0'/>
<function name='mongocursor::limit' from='PECL mongo &gt;=0.9.0'/>
<function name='mongocursor::softlimit' from='PECL mongo &gt;=0.9.0'/>
<function name='mongocursor::next' from='PECL mongo &gt;=0.9.0'/>
<function name='mongocursor::skip' from='PECL mongo &gt;=0.9.0'/>
<function name='mongocursor::sort' from='PECL mongo &gt;=0.9.0'/>
<function name='mongocursor::current' from='PECL mongo &gt;=0.9.0'/>
<function name='mongocursor::reset' from='PECL mongo &gt;=0.9.0'/>
<function name='mongocursor::rewind' from='PECL mongo &gt;=0.9.0'/>
<function name='mongocursor::valid' from='PECL mongo &gt;=0.9.0'/>
<!-- MongoUtil -->
<function name='mongoutil::dbcommand' from='PECL mongo &gt;=0.9.0'/>
<function name='mongoutil::toindexstring' from='PECL mongo &gt;=0.9.0'/>
<!-- MongoGridFS -->
<function name='mongogridfs::__construct' from='PECL mongo &gt;=0.9.0'/>
<function name='mongogridfs::find' from='PECL mongo &gt;=0.9.0'/>
<function name='mongogridfs::drop' from='PECL mongo &gt;=0.9.0'/>
<function name='mongogridfs::remove' from='PECL mongo &gt;=0.9.0'/>
<function name='mongogridfs::findone' from='PECL mongo &gt;=0.9.0'/>
<function name='mongogridfs::storefile' from='PECL mongo &gt;=0.9.0'/>
<function name='mongogridfs::storeupload' from='PECL mongo &gt;=0.9.0'/>
<!-- MongoGridFSFile -->
<function name='mongogridfsfile::__construct' from='PECL mongo &gt;=0.9.0'/>
<function name='mongogridfsfile::getbytes' from='PECL mongo &gt;=0.9.0'/>
<function name='mongogridfsfile::getfilename' from='PECL mongo &gt;=0.9.0'/>
<function name='mongogridfsfile::getsize' from='PECL mongo &gt;=0.9.0'/>
<function name='mongogridfsfile::write' from='PECL mongo &gt;=0.9.0'/>
<!-- MongoId -->
<function name='mongoid::__construct' from='PECL mongo &gt;= 0.8.0'/>
<function name='mongoid::__tostring' from='PECL mongo &gt;= 0.8.0'/>