Rechercher une fonction PHP

The MongoCollection class

(PECL mongo >=0.9.0)

Introduction

Represents a MongoDB collection.

Collection names can use any character in the ASCII set. Some valid collection names are "", "...", "my collection", and "*&#@".

User-defined collection names cannot contain the $ symbol. There are certain system collections which use a $ in their names (e.g., local.oplog.$main), but it is a reserved character. If you attempt to create and use a collection with a $ in the name, MongoDB will assert.

PHP: MongoCollection - Manual Home of Manuel PHP  Contents Haut

Class synopsis

MongoCollection {
/* Constants */
const int ASCENDING = 1 ;
const int DESCENDING = -1 ;
/* Fields */
public MongoDB $db = NULL ;
public integer $w ;
public integer $wtimeout ;
/* Methods */
public aggregate ( array $pipeline [, array $options ] ) : array
public aggregateCursor ( array $command [, array $options ] ) : MongoCommandCursor
public batchInsert ( array $a [, array $options = array() ] ) : mixed
public __construct ( MongoDB $db , string $name )
public count ([ array $query = array() [, array $options = array() ]] ) : int
public createDBRef ( mixed $document_or_id ) : array
public createIndex ( array $keys [, array $options = array() ] ) : bool
public deleteIndex ( string|array $keys ) : array
public deleteIndexes ( void ) : array
public distinct ( string $key [, array $query ] ) : array
public drop ( void ) : array
public ensureIndex ( string|array $key|keys [, array $options = array() ] ) : bool
public find ([ array $query = array() [, array $fields = array() ]] ) : MongoCursor
public findAndModify ( array $query [, array $update [, array $fields [, array $options ]]] ) : array
public findOne ([ array $query = array() [, array $fields = array() [, array $options = array() ]]] ) : array
public __get ( string $name ) : MongoCollection
public getDBRef ( array $ref ) : array
public getIndexInfo ( void ) : array
public getName ( void ) : string
public getReadPreference ( void ) : array
public getSlaveOkay ( void ) : bool
public getWriteConcern ( void ) : array
public group ( mixed $keys , array $initial , MongoCode $reduce [, array $options = array() ] ) : array
public insert ( array|object $document [, array $options = array() ] ) : bool|array
public parallelCollectionScan ( int $num_cursors ) : array[MongoCommandCursor]
public remove ([ array $criteria = array() [, array $options = array() ]] ) : bool|array
public save ( array|object $document [, array $options = array() ] ) : mixed
public setReadPreference ( string $read_preference [, array $tags ] ) : bool
public setSlaveOkay ([ bool $ok = TRUE ] ) : bool
public setWriteConcern ( mixed $w [, int $wtimeout ] ) : bool
static protected toIndexString ( mixed $keys ) : string
public __toString ( void ) : string
public update ( array $criteria , array $new_object [, array $options = array() ] ) : bool|array
public validate ([ bool $scan_data = FALSE ] ) : array
}

PHP: MongoCollection - Manual Home of Manuel PHP  Contents Haut

Predefined Constants

MongoCollection::ASCENDING
Ascending direction for sorts and index creation.
MongoCollection::DESCENDING
Descending direction for sorts and index creation.

PHP: MongoCollection - Manual Home of Manuel PHP  Contents Haut

Fields

db

The "parent" database for this collection.

w

The number of servers to replicate a change to before returning success. Value is inherited from the parent database. The MongoDB class has a more detailed description of how w works.

wtimeout

The number of milliseconds to wait for $this->w replications to take place. Value is inherited from the parent database. The MongoDB class has a more detailed description of how wtimeout works.

PHP: MongoCollection - Manual Home of Manuel PHP  Contents Haut

Table of Contents

Find a PHP function

English translation

You have asked to visit this site in English. For now, only the interface is translated, but not all the content yet.

If you want to help me in translations, your contribution is welcome. All you need to do is register on the site, and send me a message asking me to add you to the group of translators, which will give you the opportunity to translate the pages you want. A link at the bottom of each translated page indicates that you are the translator, and has a link to your profile.

Thank you in advance.

Document created the 30/01/2003, last modified the 26/10/2018
Source of the printed document:https://www.gaudry.be/en/php-rf-class.mongocollection.html

The infobrol is a personal site whose content is my sole responsibility. The text is available under CreativeCommons license (BY-NC-SA). More info on the terms of use and the author.

References

  1. View the html document Language of the document:fr Manuel PHP : http://php.net

These references and links indicate documents consulted during the writing of this page, or which may provide additional information, but the authors of these sources can not be held responsible for the content of this page.
The author This site is solely responsible for the way in which the various concepts, and the freedoms that are taken with the reference works, are presented here. Remember that you must cross multiple source information to reduce the risk of errors.

Contents Haut