Documentation

CollectionInfo
in package
implements ArrayAccess

Collection information model class.

This class models the collection information returned by the listCollections command or, for legacy servers, queries on the "system.namespaces" collection. It provides methods to access options for the collection.

Tags
see
Database::listCollections()
see
https://github.com/mongodb/specifications/blob/master/source/enumerate-collections.rst

Interfaces, Classes, Traits and Enums

ArrayAccess

Table of Contents

$info  : array<string|int, mixed>
__construct()  : mixed
__debugInfo()  : array<string|int, mixed>
Return the collection info as an array.
getCappedMax()  : int|null
Return the maximum number of documents to keep in the capped collection.
getCappedSize()  : int|null
Return the maximum size (in bytes) of the capped collection.
getIdIndex()  : array<string|int, mixed>
Return information about the _id index for the collection.
getInfo()  : array<string|int, mixed>
Return the "info" property of the server response.
getName()  : string
Return the collection name.
getOptions()  : array<string|int, mixed>
Return the collection options.
getType()  : string
Return the collection type.
isCapped()  : bool
Return whether the collection is a capped collection.
offsetExists()  : bool
Check whether a field exists in the collection information.
offsetGet()  : mixed
Return the field's value from the collection information.
offsetSet()  : void
Not supported.
offsetUnset()  : void
Not supported.

Properties

Methods

__construct()

public __construct(array<string|int, mixed> $info) : mixed
Parameters
$info : array<string|int, mixed>

Collection info

Return values
mixed

getCappedMax()

Return the maximum number of documents to keep in the capped collection.

public getCappedMax() : int|null
Tags
deprecated
1.0

Deprecated in favor of using getOptions

Return values
int|null

getCappedSize()

Return the maximum size (in bytes) of the capped collection.

public getCappedSize() : int|null
Tags
deprecated
1.0

Deprecated in favor of using getOptions

Return values
int|null

getIdIndex()

Return information about the _id index for the collection.

public getIdIndex() : array<string|int, mixed>
Return values
array<string|int, mixed>

isCapped()

Return whether the collection is a capped collection.

public isCapped() : bool
Tags
deprecated
1.0

Deprecated in favor of using getOptions

Return values
bool

Search results