Войти через VK Войти через FB Войти через Google Войти через Яндекс
Поиск по сайту
The MongoCollection class
(Информация о версии неизвестна, возможно, только в SVN)
Введение
Representations a database 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.
Обзор классов
MongoCollection {
/* Константы */
const int ASCENDING = 1 ;
const int DESCENDING = -1 ;
/* Fields */
public MongoDB $MongoCollection->db = NULL ;
public integer $w ;
public integer $wtimeout ;
/* Методы */
public mixed MongoCollection::batchInsert ( array $a [, array $options = array() ] )
public MongoCollection::__construct ( MongoDB $db , string $name )
public int MongoCollection::count ([ array $query = array() [, int $limit = 0 [, int $skip = 0 ]]] )
public array MongoCollection::createDBRef ( array $a )
public array MongoCollection::deleteIndex ( string|array $keys )
public array MongoCollection::deleteIndexes ( void )
public array MongoCollection::drop ( void )
public bool MongoCollection::ensureIndex ( string|array $key|keys [, array $options = array() ] )
public MongoCursor MongoCollection::find ([ array $query = array() [, array $fields = array() ]] )
public array MongoCollection::findOne ([ array $query = array() [, array $fields = array() ]] )
public MongoCollection MongoCollection::__get ( string $name )
public array MongoCollection::getDBRef ( array $ref )
public array MongoCollection::getIndexInfo ( void )
public string MongoCollection::getName ( void )
public bool MongoCollection::getSlaveOkay ( void )
public array MongoCollection::group ( mixed $keys , array $initial , MongoCode $reduce [, array $options = array() ] )
public bool|array MongoCollection::insert ( array $a [, array $options = array() ] )
public bool|array MongoCollection::remove ([ array $criteria = array() [, array $options = array() ]] )
public mixed MongoCollection::save ( array $a [, array $options = array() ] )
public bool MongoCollection::setSlaveOkay ([ bool $ok = true ] )
static protected string MongoCollection::toIndexString ( mixed $keys )
public string MongoCollection::__toString ( void )
public bool|array MongoCollection::update ( array $criteria , array $new_object [, array $options = array() ] )
public array MongoCollection::validate ([ bool $scan_data = FALSE ] )
}
Предопределенные константы
MongoCollection::ASCENDING
1 - Ascending direction for sorts and index creation.
MongoCollection::DESCENDING
-1 - Descending direction for sorts and index creation.
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.
Содержание
- MongoCollection::batchInsert — Inserts multiple documents into this collection
- MongoCollection::__construct — Creates a new collection
- MongoCollection::count — Counts the number of documents in this collection
- MongoCollection::createDBRef — Creates a database reference
- MongoCollection::deleteIndex — Deletes an index from this collection
- MongoCollection::deleteIndexes — Delete all indices for this collection
- MongoCollection::drop — Drops this collection
- MongoCollection::ensureIndex — Creates an index on the given field(s), or does nothing if the index already exists
- MongoCollection::find — Querys this collection, returning a MongoCursor for the result set
- MongoCollection::findOne — Querys this collection, returning a single element
- MongoCollection::__get — Gets a collection
- MongoCollection::getDBRef — Fetches the document pointed to by a database reference
- MongoCollection::getIndexInfo — Returns information about indexes on this collection
- MongoCollection::getName — Returns this collection's name
- MongoCollection::getSlaveOkay — Get slaveOkay setting for this collection
- MongoCollection::group — Performs an operation similar to SQL's GROUP BY command
- MongoCollection::insert — Inserts an array into the collection
- MongoCollection::remove — Remove records from this collection
- MongoCollection::save — Saves an object to this collection
- MongoCollection::setSlaveOkay — Change slaveOkay setting for this collection
- MongoCollection::toIndexString — Converts keys specifying an index to its identifying string
- MongoCollection::__toString — String representation of this collection
- MongoCollection::update — Update records based on a given criteria
- MongoCollection::validate — Validates this collection
Смотрите также
MongoDB core docs on » collections.Описание класса mongocollection, примеры использования класса mongocollection.
Описание на ru2.php.netОписание на php.ru