(PECL mongo >=0.9.0)
はじめに
MongoDB のコレクションを表します。
コレクション名は ASCII セット内の任意の文字を使用できます。たとえば ""、"..."、"my collection" そして "*&#@" といった名前をつけることができます。
ユーザー定義のコレクション名には $ 記号を含めることができません。システムコレクションの中には $ を名前に使うものがあります (local.oplog.$main など) が、 これは予約文字です。名前に $ を含むコレクションを作ったり使ったりしようとすると、 MongoDB が assert を出します。
クラス概要
MongoCollection {
const
int
ASCENDING
= 1
const
int
DESCENDING
= -1
/* フィールド */
public
MongoDB
$db
= null
public
int
$w
public
int
$wtimeout
/* メソッド */
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 ( ) : array
public distinct
( string $key
[, array $query
] ) : array|false
public drop ( ) : 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 ( ) : array
public getName ( ) : string
public getReadPreference ( ) : array
public getSlaveOkay ( ) : bool
public getWriteConcern ( ) : 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 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 ( ) : string
public update
( array $criteria
, array $new_object
[, array $options
= array()
] ) : bool|array
public validate
([ bool $scan_data
= false
] ) : array
}
定義済み定数
MongoCollection::ASCENDING
- ソートやインデックス作成時に使用する「昇順」。
MongoCollection::DESCENDING
- ソートやインデックス作成時に使用する「降順」。
目次
- MongoCollection::aggregate — aggregation フレームワークを使って集約する
- MongoCollection::aggregateCursor — Execute an aggregation pipeline command and retrieve results through a cursor
- MongoCollection::batchInsert — 複数のドキュメントをコレクションに追加する
- MongoCollection::__construct — 新しいコレクションを作成する
- MongoCollection::count — コレクション内のドキュメント数を数える
- MongoCollection::createDBRef — データベースへの参照を作成する
- MongoCollection::createIndex — Creates an index on the specified field(s) if it does not already exist
- MongoCollection::deleteIndex — コレクションからインデックスを削除する
- MongoCollection::deleteIndexes — コレクションのすべてのインデックスを削除する
- MongoCollection::distinct — Retrieve a list of distinct values for the given key across a collection
- MongoCollection::drop — コレクションを削除する
- MongoCollection::ensureIndex — Creates an index on the specified field(s) if it does not already exist
- MongoCollection::find — コレクションに問い合わせ、結果セットの MongoCursor を返す
- MongoCollection::findAndModify — ドキュメントを更新して返す
- MongoCollection::findOne — コレクションに問い合わせ、単一の要素を返す
- MongoCollection::__get — コレクションを取得する
- MongoCollection::getDBRef — データベース参照が指すドキュメントを取得する
- MongoCollection::getIndexInfo — このコレクションのインデックスについての情報を返す
- MongoCollection::getName — コレクションの名前を返す
- MongoCollection::getReadPreference — このコレクションの優先読み込みを取得する
- MongoCollection::getSlaveOkay — このコレクションの slaveOkay 設定を取得する
- MongoCollection::getWriteConcern — Get the write concern for this collection
- MongoCollection::group — SQL の GROUP BY コマンドと似た処理を行う
- MongoCollection::insert — ドキュメントをコレクションに追加する
- MongoCollection::parallelCollectionScan — Returns an array of cursors to iterator over a full collection in parallel
- MongoCollection::remove — レコードをコレクションから削除する
- MongoCollection::save — ドキュメントをコレクションに保存する
- MongoCollection::setReadPreference — このコレクションの優先読み込みを設定する
- MongoCollection::setSlaveOkay — Change slaveOkay setting for this collection
- MongoCollection::setWriteConcern — Set the write concern for this database
- MongoCollection::toIndexString — インデックスを指定するキーを、インデックスを指す文字列に変換する
- MongoCollection::__toString — このコレクションの文字列表現
- MongoCollection::update — 指定した条件にもとづいてレコードを更新する
- MongoCollection::validate — コレクションを検証する
/* 定数 */