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.md
template-implements

Table of Contents

Interfaces

ArrayAccess

Properties

$info  : array<string|int, mixed>

Methods

__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.
isView()  : bool
Determines whether the collection is a view.
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

getCappedMax()

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

public getCappedMax() : int|null

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

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

Deprecated in favor of using getOptions

Return values
bool

isView()

Determines whether the collection is a view.

public isView() : bool
Return values
bool

        
On this page

Search results