Differences Between: [Versions 400 and 401]
(no description)
File Size: | 432 lines (12 kb) |
Included or required: | 1 time |
Referenced: | 0 times |
Includes or requires: | 0 files |
apply_type_map_to_document($document, array $typeMap) X-Ref |
Applies a type map to a document. This function is used by operations where it is not possible to apply a type map to the cursor directly because the root document is a command response (e.g. findAndModify). return: array|object param: array|object $document Document to which the type map will be applied param: array $typeMap Type map for BSON deserialization. |
generate_index_name($document) X-Ref |
Generate an index name from a key specification. return: string param: array|object $document Document containing fields mapped to values, |
is_first_key_operator($document) X-Ref |
Return whether the first key in the document starts with a "$" character. This is used for differentiating update and replacement documents. return: boolean param: array|object $document Update or replacement document |
is_pipeline($pipeline) X-Ref |
Returns whether an update specification is a valid aggregation pipeline. return: boolean param: mixed $pipeline |
is_in_transaction(array $options) X-Ref |
Returns whether we are currently in a transaction. return: boolean param: array $options Command options |
is_last_pipeline_operator_write(array $pipeline) X-Ref |
Return whether the aggregation pipeline ends with an $out or $merge operator. This is used for determining whether the aggregation pipeline must be executed against a primary server. return: boolean param: array $pipeline List of pipeline operations |
is_mapreduce_output_inline($out) X-Ref |
Return whether the "out" option for a mapReduce operation is "inline". This is used to determine if a mapReduce command requires a primary. return: boolean param: string|array|object $out Output specification |
server_supports_feature(Server $server, $feature) X-Ref |
Return whether the server supports a particular feature. return: boolean param: Server $server Server to check param: integer $feature Feature constant (i.e. wire protocol version) |
is_string_array($input) X-Ref |
No description |
recursive_copy($element) X-Ref |
Performs a deep copy of a value. This function will clone objects and recursively copy values within arrays. return: mixed param: mixed $element Value to be copied |
create_field_path_type_map(array $typeMap, $fieldPath) X-Ref |
Creates a type map to apply to a field type This is used in the Aggregate, Distinct, and FindAndModify operations to apply the root-level type map to the document that will be returned. It also replaces the root type with object for consistency within these operations An existing type map for the given field path will not be overwritten return: array param: array $typeMap The existing typeMap param: string $fieldPath The field path to apply the root type to |
with_transaction(Session $session, callable $callback, array $transactionOptions = []) X-Ref |
Execute a callback within a transaction in the given session This helper takes care of retrying the commit operation or the entire transaction if an error occurs. If the commit fails because of an UnknownTransactionCommitResult error, the commit is retried without re-invoking the callback. If the commit fails because of a TransientTransactionError, the entire transaction will be retried. In this case, the callback will be invoked again. It is important that the logic inside the callback is idempotent. In case of failures, the commit or transaction are retried until 120 seconds from the initial call have elapsed. After that, no retries will happen and the helper will throw the last exception received from the driver. return: void param: Session $session A session object as retrieved by Client::startSession param: callable $callback A callback that will be invoked within the transaction param: array $transactionOptions Additional options that are passed to Session::startTransaction |
extract_session_from_options(array $options) X-Ref |
Returns the session option if it is set and valid. return: Session|null param: array $options |
extract_read_preference_from_options(array $options) X-Ref |
Returns the readPreference option if it is set and valid. return: ReadPreference|null param: array $options |
select_server(Manager $manager, array $options) X-Ref |
Performs server selection, respecting the readPreference and session options (if given) return: Server |