Skip to content

Commit

Permalink
Update docs for new async pouch creation
Browse files Browse the repository at this point in the history
  • Loading branch information
benrudolph committed Mar 24, 2013
1 parent e2d60c3 commit 92eab53
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions docs/api.md
Expand Up @@ -43,17 +43,14 @@ Retrieves all databases from PouchDB.

## Create a database

Pouch('dbname', [options], [callback])
Pouch('http://localhost:5984/dbname', [options], [callback])
var pouchdb = Pouch('dbname', [options])
var pouchdb = Pouch('http://localhost:5984/dbname', [options])

This method gets an existing database if one exists or creates a new one if one does not exist. You may also explicitly specify which backend you want to use for local database (e.g. `idb://dbname` or `leveldb://dbname`) but usually it is convenient to let PouchDB choose the best backend by itself.

var pouchdb;
Pouch('test', function(err, db) {
pouchdb = db;
// Use pouchdb to call further functions
pouchdb.post(....
})
var pouchdb = Pouch('test');

pouchdb.post(...;

## Delete a database

Expand Down Expand Up @@ -243,7 +240,7 @@ Fetch multiple documents, deleted document are only included if `options.keys` i
* `options.keys`: array of keys you want to get
- neither `startkey` nor `endkey` can be specified with this option
- the rows are returned in the same order as the supplied "keys" array
- the row for a deleted document will have the revision ID of the deletion, and an extra key "deleted":true in the "value" property
- the row for a deleted document will have the revision ID of the deletion, and an extra key "deleted":true in the "value" property
- the row for a nonexistent document will just contain an "error" property with the value "not_found"
* `options.attachments`: Include attachment data

Expand Down Expand Up @@ -415,7 +412,7 @@ If `options.continuous` is set it returns object with one method `cancel` which
* `options.since`: Start the results from the change immediately after the given sequence number
* `options.complete`: Function called when all changes have been processed
* `options.continuous`: Use _longpoll_ feed
* `options.onChange`: Function called on each change after deduplication (only sends the most recent for each document), not called as a callback but called as onChange(change). Use with `continuous` flag. If you want to
* `options.onChange`: Function called on each change after deduplication (only sends the most recent for each document), not called as a callback but called as onChange(change). Use with `continuous` flag. If you want to

<span></span>

Expand Down Expand Up @@ -506,7 +503,7 @@ Replicate one database to another.

db.revsDiff(diff, [callback])

Given a set of document/revision IDs, returns the subset of those that do not correspond
Given a set of document/revision IDs, returns the subset of those that do not correspond
to revisions stored in the database. Primarily used in replication.

db.revsDiff({
Expand Down

0 comments on commit 92eab53

Please sign in to comment.