MongoDB::__toString
MongoCollection::batchInsert
Mongo
PHP Manual

# The MongoCollection class

## Introducción

Representations a database collection.

Collection names cannot have a "$" in them, but other than that they can use any character in the ASCII set. Some valid collection names are "", "...", "my collection", and "*&#@".

## Class synopsis

MongoCollection
MongoCollection {
/* Methods */
public boolean batchInsert ( array `$a` )
public __construct ( MongoDB `$db` , string `$name` )
public int count ([ array `$query`= array() [, array `$fields`= array() ]] )
public array createDBRef ( array `$a` )
public array deleteIndex ( string|array `$keys` )
public array deleteIndexes ( void )
public array drop ( void )
public boolean ensureIndex ( string|array `$keys` )
public MongoCursor find ([ array `$query`= array() [, array `$fields`= array() ]] )
public array findOne ([ array `$query`= array() ] )
public array getDBRef ( array `$ref` )
public array getIndexInfo ( void )
public string getName ( void )
public boolean insert ( array `$a` )
public boolean remove ( array `$criteria` [, boolean `$justOne`= `FALSE` ] )
public boolean save ( array `$a` )
public string __toString ( void )
public boolean update ( array `$criteria` , array `$newobj` [, boolean `$upsert`= `FALSE` ] )
public array validate ([ bool `$scan_data`= `FALSE` ] )
}

## Table of Contents

- MongoCollection::batchInsert — Inserts an array of arrays into the 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
- MongoCollection::findOne — Querys this collection, returning a single element
- MongoCollection::getDBRef — Fetches a database reference
- MongoCollection::getIndexInfo — Returns an array of index names for this collection
- MongoCollection::getName — Returns this collection's name
- MongoCollection::insert — Inserts an array into the collection
- MongoCollection::remove — Remove records from this collection
- MongoCollection::save — Saves an object to this collection
- MongoCollection::__toString — String representation of this collection
- MongoCollection::update — Update records based on a given criteria
- MongoCollection::validate — Validates this collection

MongoDB::__toString
MongoCollection::batchInsert
Mongo
PHP Manual