Skip to content

Commit

Permalink
Update docs. All implemented functions are now included.
Browse files Browse the repository at this point in the history
  • Loading branch information
sorribas committed Apr 2, 2014
1 parent cb3dec2 commit bc4f031
Showing 1 changed file with 73 additions and 17 deletions.
90 changes: 73 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -162,41 +162,97 @@ For more detailed information about replica sets see [the mongo replication docs

This API documentation is a work in progress.

### Collection
#### Collection

#### `db.collection.aggregate([pipeline], callback)`
#####`db.collection.aggregate([pipeline], callback)`

#### `db.collection.count([query], callback)`
#####`db.collection.count([query], callback)`

#### `db.collection.find([criteria], [projection], [callback])`
#####`db.collection.createIndex(keys, options, [callback])`

#####`db.collection.distinct(field, query, callback)`

#####`db.collection.drop([callback])`

#####`db.collection.dropIndex(index, [callback])`

#####`db.collection.dropIndexes([callback])`

#####`db.collection.ensureIndex(keys, options, [callback])`

#####`db.collection.find([criteria], [projection], [callback])`

This function applies a query to a collection. You can get the return value, which is a cursor, or pass a callback
as the last parameter. Said callback receives `(err, documents)`

#### `db.collection.findOne([criteria], [projection], callback)`
#####`db.collection.findOne([criteria], [projection], callback)`

Apply a query and get one single document passed as a callback. The callback receives `(err, document)`

#### `db.collection.insert(docOrDocs, callback)`
#####`db.collection.findAndModify(document, callback)`

#####`db.collection.getIndexes(callback)`

#####`db.collection.group(document, callback)`

#####`db.collection.insert(docOrDocs, callback)`

#####`db.collection.isCapped(callback)`

#####`db.collection.mapReduce(map, reduce, options, callback)`

#####`db.collection.reIndex(callback)`

#####`db.collection.remove(query, [justOne], [callback])`

#####`db.collection.runCommand(command, callback)`

#####`db.collection.save(doc, callback)`

#####`db.collection.stats(callback)`

#####`db.collection.update(query, update, [options], callback)`

#### Cursor

#####`cursor.batchSize(size, [callback])`

#####`cursor.count(callback)`

#####`cursor.explain(callback)`

#####`cursor.forEach(function)`

#####`cursor.limit(n, [callback])`

#####`cursor.map(function, [callback])`

#####`cursor.next(callback)`

#####`cursor.skip(n, [callback])`

#####`cursor.sort(sortOptions, [callback])`

#####`cursor.toArray(callback)`

#### `db.collection.runCommand(command, callback)`
#### Database

#### `db.collection.save(doc, callback)`
#####`db.addUser(document)`

#### `db.collection.update(query, update, [options], callback)`
#####`db.createCollection(name, options, [callback])`

### Cursor
#####`db.dropDatabase([callback])`

#### `cursor.toArray(callback)`
#####`db.eval(function, arguments)`

#### `cursor.forEach(function)`
#####`db.getCollectionNames([callback])`

#### `cursor.limit(n, [callback])`
#####`db.getLastError([callback])`

#### `cursor.map(function, [callback])`
#####`db.getLastErrorObj([callback])`

#### `cursor.next(callback)`
#####`db.removeUser(username, [callback])`

#### `cursor.skip(n, [callback])`
#####`db.runCommand(command, [callback])`

#### `cursor.sort(sortOptions, [callback])`
#####`db.stats([callback])`

0 comments on commit bc4f031

Please sign in to comment.