php-doc-en/reference/mongo/mongodb/getcollectionnames.xml
2013-01-31 14:45:04 +00:00

100 lines
2.3 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<refentry xml:id="mongodb.getcollectionnames" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>MongoDB::getCollectionNames</refname>
<refpurpose>Get all collections from this database</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<modifier>public</modifier> <type>array</type><methodname>MongoDB::getCollectionNames</methodname>
<methodparam choice="opt"><type>bool</type><parameter>includeSystemCollections</parameter><initializer>false</initializer></methodparam>
</methodsynopsis>
<para>
Returns an array of all the collection names for the given database.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<variablelist>
<varlistentry>
<term><parameter>includeSystemCollections</parameter></term>
<listitem>
<para>
Include system collections.
</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Returns the names of the all the collections in the database as an <type>array</type>.
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<example>
<title><function>MongoDB::getCollectionNames</function> example</title>
<programlisting role="php">
<![CDATA[
<?php
$m = new Mongo;
$collections = $m->selectDB("demo")->getCollectionNames());'
var_dump($collections);
]]>
</programlisting>
&example.outputs.similar;
<screen>
<![CDATA[
array(2) {
[0]=>
string(9) "addresses"
[1]=>
string(5) "users"
}
]]>
</screen>
</example>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><function>MongoDB::listCollections</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:"~/.phpdoc/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
-->