PHP Класс Phalcon\Db\Adapter\MongoDB\Functions

Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
extractIdFromInsertedDocument ( array | object $document ) : mixed Extracts an ID from an inserted document.
generateIndexName ( array | object $document ) : string Generate an index name from a key specification.
isFirstKeyOperator ( array | object $document ) : boolean Return whether the first key in the document starts with a "$" character.
isLastPipelineOperatorOut ( array $pipeline ) : boolean Return whether the aggregation pipeline ends with an $out operator.
isStringArray ( $input ) : boolean
readConcernAsDocument ( MongoDB\Driver\ReadConcern $readConcern ) : stdClass Converts a ReadConcern instance to a stdClass for use in a BSON document.
serverSupportsFeature ( MongoDB\Driver\Server $server, integer $feature ) : boolean Return whether the server supports a particular feature.

Описание методов

extractIdFromInsertedDocument() публичный статический метод

This function is used when BulkWrite::insert() does not return a generated ID, which means that the ID should be fetched from an array offset, public property, or in the data returned by bsonSerialize().
См. также: https://jira.mongodb.org/browse/PHPC-382
public static extractIdFromInsertedDocument ( array | object $document ) : mixed
$document array | object Inserted document
Результат mixed

generateIndexName() публичный статический метод

Generate an index name from a key specification.
public static generateIndexName ( array | object $document ) : string
$document array | object Document containing fields mapped to values, which denote order or an index type
Результат string

isFirstKeyOperator() публичный статический метод

This is used for differentiating update and replacement documents.
public static isFirstKeyOperator ( array | object $document ) : boolean
$document array | object Update or replacement document
Результат boolean

isLastPipelineOperatorOut() публичный статический метод

This is used for determining whether the aggregation pipeline msut be executed against a primary server.
public static isLastPipelineOperatorOut ( array $pipeline ) : boolean
$pipeline array List of pipeline operations
Результат boolean

isStringArray() публичный статический метод

public static isStringArray ( $input ) : boolean
$input
Результат boolean

readConcernAsDocument() публичный статический метод

Converts a ReadConcern instance to a stdClass for use in a BSON document.
См. также: https://jira.mongodb.org/browse/PHPC-498
public static readConcernAsDocument ( MongoDB\Driver\ReadConcern $readConcern ) : stdClass
$readConcern MongoDB\Driver\ReadConcern Read concern
Результат stdClass

serverSupportsFeature() публичный статический метод

Return whether the server supports a particular feature.
public static serverSupportsFeature ( MongoDB\Driver\Server $server, integer $feature ) : boolean
$server MongoDB\Driver\Server Server to check
$feature integer Feature constant (i.e. wire protocol version)
Результат boolean