Commit 830148b5 authored by Jeremy Mikola's avatar Jeremy Mikola

PHPLIB-235: Document enumeration model classes

parent cc14abc7
......@@ -13,4 +13,5 @@ Reference
/reference/class/MongoDBCollection
/reference/class/MongoDBGridFSBucket
/reference/write-result-classes
/reference/enumeration-classes
/reference/exception-classes
===================
Enumeration Classes
===================
.. default-domain:: mongodb
.. contents:: On this page
:local:
:backlinks: none
:depth: 1
:class: singlecol
MongoDB\\Model\\CollectionInfo
------------------------------
Definition
~~~~~~~~~~
.. phpclass:: MongoDB\\Model\\CollectionInfo
This class models information about a collection. Instances of this class are
returned by traversing a :phpclass:`MongoDB\\Model\\CollectionInfoIterator`,
which is returned by :phpmethod:`MongoDB\\Database::listCollections()`.
Methods
~~~~~~~
.. toctree::
:titlesonly:
/reference/method/MongoDBModelCollectionInfo-getCappedMax
/reference/method/MongoDBModelCollectionInfo-getCappedSize
/reference/method/MongoDBModelCollectionInfo-getName
/reference/method/MongoDBModelCollectionInfo-getOptions
/reference/method/MongoDBModelCollectionInfo-isCapped
----
MongoDB\\Model\\CollectionInfoIterator
--------------------------------------
Definition
~~~~~~~~~~
.. phpclass:: MongoDB\\Model\\CollectionInfoIterator
This interface extends PHP's :php:`Iterator <manual/en/class.iterator.php>`
interface. An instance of this interface is returned by
:phpmethod:`MongoDB\\Database::listCollections()`.
Methods
~~~~~~~
This interface adds no new methods to :php:`Iterator
<manual/en/class.iterator.php>`, but specifies that :php:`current()
<manual/en/iterator.current.php>` will return an instance of
:phpclass:`MongoDB\\Model\\CollectionInfo`.
----
MongoDB\\Model\\DatabaseInfo
----------------------------
Definition
~~~~~~~~~~
.. phpclass:: MongoDB\\Model\\DatabaseInfo
This class models information about a database. Instances of this class are
returned by traversing a :phpclass:`MongoDB\\Model\\DatabaseInfoIterator`,
which is returned by :phpmethod:`MongoDB\\Client::listDatabases()`.
Methods
~~~~~~~
.. toctree::
:titlesonly:
/reference/method/MongoDBModelDatabaseInfo-getName
/reference/method/MongoDBModelDatabaseInfo-getSizeOnDisk
/reference/method/MongoDBModelDatabaseInfo-isEmpty
----
MongoDB\\Model\\DatabaseInfoIterator
------------------------------------
Definition
~~~~~~~~~~
.. phpclass:: MongoDB\\Model\\DatabaseInfoIterator
This interface extends PHP's :php:`Iterator <manual/en/class.iterator.php>`
interface. An instance of this interface is returned by
:phpmethod:`MongoDB\\Client::listDatabases()`.
Methods
~~~~~~~
This interface adds no new methods to :php:`Iterator
<manual/en/class.iterator.php>`, but specifies that :php:`current()
<manual/en/iterator.current.php>` will return an instance of
:phpclass:`MongoDB\\Model\\DatabaseInfo`.
----
MongoDB\\Model\\IndexInfo
-------------------------
.. phpclass:: MongoDB\\Model\\IndexInfo
This class models information about an index. Instances of this class are
returned by traversing a :phpclass:`MongoDB\\Model\\IndexInfoIterator`,
which is returned by :phpmethod:`MongoDB\\Collection::listIndexes()`.
This class implements PHP's :php:`ArrayAccess <arrayaccess>` interface. This
provides a mechanism for accessing index fields for which there exists no
helper method. :php`isset() <isset>` may be used to check for the existence
of a field before accessing it with ``[]``.
.. note::
The :phpclass:`MongoDB\\Model\\IndexInfo` class is immutable. Attempting
to modify it via the :php:`ArrayAccess <arrayaccess>` interface will
result in a :phpclass:`MongoDB\\Exception\\BadMethodCallException`.
Methods
~~~~~~~
.. toctree::
:titlesonly:
/reference/method/MongoDBModelIndexInfo-getKey
/reference/method/MongoDBModelIndexInfo-getName
/reference/method/MongoDBModelIndexInfo-getNamespace
/reference/method/MongoDBModelIndexInfo-getVersion
/reference/method/MongoDBModelIndexInfo-isSparse
/reference/method/MongoDBModelIndexInfo-isTtl
/reference/method/MongoDBModelIndexInfo-isUnique
----
MongoDB\\Model\\IndexInfoIterator
---------------------------------
Definition
~~~~~~~~~~
.. phpclass:: MongoDB\\Model\\IndexInfoIterator
This interface extends PHP's :php:`Iterator <manual/en/class.iterator.php>`
interface. An instance of this interface is returned by
:phpmethod:`MongoDB\\Collection::listIndexes()`.
Methods
~~~~~~~
This interface adds no new methods to :php:`Iterator
<manual/en/class.iterator.php>`, but specifies that :php:`current()
<manual/en/iterator.current.php>` will return an instance of
:phpclass:`MongoDB\\Model\\IndexInfo`.
==============================================
MongoDB\\Model\\CollectionInfo::getCappedMax()
==============================================
.. default-domain:: mongodb
.. contents:: On this page
:local:
:backlinks: none
:depth: 1
:class: singlecol
Definition
----------
.. phpmethod:: MongoDB\\Model\\CollectionInfo::getCappedMax()
Return the document limit for the capped collection. This correlates with the
``max`` option for :phpmethod:`MongoDB\\Database::createCollection()`.
.. code-block:: php
function getCappedMax(): integer|null
Return Values
-------------
The document limit for the capped collection. If the collection is not capped,
``null`` will be returned.
See Also
--------
- :phpmethod:`MongoDB\\Model\\CollectionInfo::getCappedSize()`
- :phpmethod:`MongoDB\\Model\\CollectionInfo::isCapped()`
- :phpmethod:`MongoDB\\Database::createCollection()`
- :manual:`Capped Collections </core/capped-collections>` in the MongoDB manual
- :manual:`listCollections </reference/command/listCollections>` command
reference in the MongoDB manual
===============================================
MongoDB\\Model\\CollectionInfo::getCappedSize()
===============================================
.. default-domain:: mongodb
.. contents:: On this page
:local:
:backlinks: none
:depth: 1
:class: singlecol
Definition
----------
.. phpmethod:: MongoDB\\Model\\CollectionInfo::getCappedSize()
Return the size limit for the capped collection in bytes. This correlates
with the ``size`` option for
:phpmethod:`MongoDB\\Database::createCollection()`.
.. code-block:: php
function getCappedSize(): integer|null
Return Values
-------------
The size limit for the capped collection in bytes. If the collection is not
capped, ``null`` will be returned.
See Also
--------
- :phpmethod:`MongoDB\\Model\\CollectionInfo::getCappedMax()`
- :phpmethod:`MongoDB\\Model\\CollectionInfo::isCapped()`
- :phpmethod:`MongoDB\\Database::createCollection()`
- :manual:`Capped Collections </core/capped-collections>` in the MongoDB manual
- :manual:`listCollections </reference/command/listCollections>` command
reference in the MongoDB manual
=========================================
MongoDB\\Model\\CollectionInfo::getName()
=========================================
.. default-domain:: mongodb
.. contents:: On this page
:local:
:backlinks: none
:depth: 1
:class: singlecol
Definition
----------
.. phpmethod:: MongoDB\\Model\\CollectionInfo::getName()
Return the collection name.
.. code-block:: php
function getName(): string
Return Values
-------------
The collection name.
See Also
--------
- :phpmethod:`MongoDB\\Collection::getCollectionName()`
- :manual:`listCollections </reference/command/listCollections>` command
reference in the MongoDB manual
============================================
MongoDB\\Model\\CollectionInfo::getOptions()
============================================
.. default-domain:: mongodb
.. contents:: On this page
:local:
:backlinks: none
:depth: 1
:class: singlecol
Definition
----------
.. phpmethod:: MongoDB\\Model\\CollectionInfo::getOptions()
Return the collection options. This correlates with the options for
:phpmethod:`MongoDB\\Database::createCollection()`, but may include
additional fields set by the server.
.. code-block:: php
function getOptions(): array
Return Values
-------------
The collection options.
See Also
--------
- :phpmethod:`MongoDB\\Database::createCollection()`
- :manual:`listCollections </reference/command/listCollections>` command
reference in the MongoDB manual
==========================================
MongoDB\\Model\\CollectionInfo::isCapped()
==========================================
.. default-domain:: mongodb
.. contents:: On this page
:local:
:backlinks: none
:depth: 1
:class: singlecol
Definition
----------
.. phpmethod:: MongoDB\\Model\\CollectionInfo::isCapped()
Return whether the collection is a :manual:`capped collection
</core/capped-collections>`.
.. code-block:: php
function isCapped(): boolean
Return Values
-------------
A boolean indicating whether the collection is a capped collection.
See Also
--------
- :phpmethod:`MongoDB\\Model\\CollectionInfo::getCappedMax()`
- :phpmethod:`MongoDB\\Model\\CollectionInfo::getCappedSize()`
- :manual:`Capped Collections </core/capped-collections>` in the MongoDB manual
- :manual:`listCollections </reference/command/listCollections>` command
reference in the MongoDB manual
=======================================
MongoDB\\Model\\DatabaseInfo::getName()
=======================================
.. default-domain:: mongodb
.. contents:: On this page
:local:
:backlinks: none
:depth: 1
:class: singlecol
Definition
----------
.. phpmethod:: MongoDB\\Model\\DatabaseInfo::getName()
Return the database name.
.. code-block:: php
function getName(): string
Return Values
-------------
The database name.
See Also
--------
- :phpmethod:`MongoDB\\Database::getDatabaseName()`
- :manual:`listDatabases </reference/command/listDatabases>` command reference
in the MongoDB manual
=============================================
MongoDB\\Model\\DatabaseInfo::getSizeOnDisk()
=============================================
.. default-domain:: mongodb
.. contents:: On this page
:local:
:backlinks: none
:depth: 1
:class: singlecol
Definition
----------
.. phpmethod:: MongoDB\\Model\\DatabaseInfo::getSizeOnDisk()
Return the total size of the database file on disk in bytes.
.. code-block:: php
function getSizeOnDisk(): integer
Return Values
-------------
The total size of the database file on disk in bytes.
See Also
--------
- :manual:`listDatabases </reference/command/listDatabases>` command reference
in the MongoDB manual
=======================================
MongoDB\\Model\\DatabaseInfo::isEmpty()
=======================================
.. default-domain:: mongodb
.. contents:: On this page
:local:
:backlinks: none
:depth: 1
:class: singlecol
Definition
----------
.. phpmethod:: MongoDB\\Model\\DatabaseInfo::isEmpty()
Return whether the database has any data.
.. code-block:: php
function isEmpty(): boolean
Return Values
-------------
A boolean indicating whether the database has any data.
See Also
--------
- :manual:`listDatabases </reference/command/listDatabases>` command reference
in the MongoDB manual
===================================
MongoDB\\Model\\IndexInfo::getKey()
===================================
.. default-domain:: mongodb
.. contents:: On this page
:local:
:backlinks: none
:depth: 1
:class: singlecol
Definition
----------
.. phpmethod:: MongoDB\\Model\\IndexInfo::getKey()
Return the index specification (i.e. indexed field(s) and order). This
correlates with the ``$key`` parameter for
:phpmethod:`MongoDB\\Collection::createIndex()`.
.. code-block:: php
function getKey(): array
Return Values
-------------
The index specification as an associative array.
See Also
--------
- :phpmethod:`MongoDB\\Collection::createIndex()`
- :manual:`listIndexes </reference/command/listIndexes>` command reference in
the MongoDB manual
====================================
MongoDB\\Model\\IndexInfo::getName()
====================================
.. default-domain:: mongodb
.. contents:: On this page
:local:
:backlinks: none
:depth: 1
:class: singlecol
Definition
----------
.. phpmethod:: MongoDB\\Model\\IndexInfo::getName()
Return the index name. This correlates with the return value of
:phpmethod:`MongoDB\\Collection::createIndex()`. An index name may be derived
from the ``$key`` parameter or or explicitly specified via the ``name``
option.
.. code-block:: php
function getName(): string
Return Values
-------------
The index name.
See Also
--------
- :phpmethod:`MongoDB\\Collection::createIndex()`
- :manual:`listIndexes </reference/command/listIndexes>` command reference in
the MongoDB manual
=========================================
MongoDB\\Model\\IndexInfo::getNamespace()
=========================================
.. default-domain:: mongodb
.. contents:: On this page
:local:
:backlinks: none
:depth: 1
:class: singlecol
Definition
----------
.. phpmethod:: MongoDB\\Model\\IndexInfo::getNamespace()
Return the index namespace, which is the namespace of the collection
containing the index.
.. code-block:: php
function getNamespace(): string
Return Values
-------------
The index namespace.
See Also
--------
- :phpmethod:`MongoDB\\Collection::createIndex()`
- :phpmethod:`MongoDB\\Collection::getNamespace()`
- :manual:`listIndexes </reference/command/listIndexes>` command reference in
the MongoDB manual
=======================================
MongoDB\\Model\\IndexInfo::getVersion()
=======================================
.. default-domain:: mongodb
.. contents:: On this page
:local:
:backlinks: none
:depth: 1
:class: singlecol
Definition
----------
.. phpmethod:: MongoDB\\Model\\IndexInfo::getVersion()
Return the index version.
.. code-block:: php
function getVersion(): integer
Return Values
-------------
The index version.
See Also
--------
- :phpmethod:`MongoDB\\Collection::createIndex()`
- :manual:`listIndexes </reference/command/listIndexes>` command reference in
the MongoDB manual
=====================================
MongoDB\\Model\\IndexInfo::isSparse()
=====================================
.. default-domain:: mongodb
.. contents:: On this page
:local:
:backlinks: none
:depth: 1
:class: singlecol
Definition
----------
.. phpmethod:: MongoDB\\Model\\IndexInfo::isSparse()
Return whether the index is a :manual:`sparse index </core/index-sparse>`.
This correlates with the ``sparse`` option for
:phpmethod:`MongoDB\\Collection::createIndex()`.
.. code-block:: php
function isSparse(): boolean
Return Values
-------------
A boolean indicating whether the index is a sparse index.
See Also
--------
- :phpmethod:`MongoDB\\Collection::createIndex()`
- :manual:`listIndexes </reference/command/listIndexes>` command reference in
the MongoDB manual
- :manual:`Sparse Indexes </core/index-sparse>` in the MongoDB manual
==================================
MongoDB\\Model\\IndexInfo::isTtl()
==================================
.. default-domain:: mongodb
.. contents:: On this page
:local:
:backlinks: none
:depth: 1
:class: singlecol
Definition
----------
.. phpmethod:: MongoDB\\Model\\IndexInfo::isTtl()
Return whether the index is a :manual:`TTL index </core/index-ttl>`. This
correlates with the ``expireAfterSeconds`` option for
:phpmethod:`MongoDB\\Collection::createIndex()`.
.. code-block:: php
function isTtl(): boolean
Return Values
-------------
A boolean indicating whether the index is a TTL index.
See Also
--------
- :phpmethod:`MongoDB\\Collection::createIndex()`
- :manual:`listIndexes </reference/command/listIndexes>` command reference in
the MongoDB manual
- :manual:`TTL Indexes </core/index-ttl>` in the MongoDB manual
=====================================
MongoDB\\Model\\IndexInfo::isUnique()
=====================================
.. default-domain:: mongodb
.. contents:: On this page
:local:
:backlinks: none
:depth: 1
:class: singlecol
Definition
----------
.. phpmethod:: MongoDB\\Model\\IndexInfo::isUnique()
Return whether the index is a :manual:`unique index </core/index-unique>`.
This correlates with the ``unique`` option for
:phpmethod:`MongoDB\\Collection::createIndex()`.
.. code-block:: php
function isUnique(): boolean
Return Values
-------------
A boolean indicating whether the index is a unique index.
See Also
--------
- :phpmethod:`MongoDB\\Collection::createIndex()`
- :manual:`listIndexes </reference/command/listIndexes>` command reference in
the MongoDB manual
- :manual:`Unique Indexes </core/index-unique>` in the MongoDB manual
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment