Skip to content

Commit

Permalink
Add docs for nStore#all()
Browse files Browse the repository at this point in the history
  • Loading branch information
creationix committed Jul 13, 2010
1 parent 9ff2cf4 commit fb99d78
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions README.markdown
Expand Up @@ -62,6 +62,19 @@ Sometimes you want to search a database for certain documents and you don't know

This is a full stream interface complete with `pause` and `resume`. Any rows that are read from the disk while it's paused will be queued internally, but will call the pre-filter function right away so it doesn't buffer results we don't want to keep.

## Searching for documents

You can search for documents using streams with a filter, but sometimes it's easier to just get the aggregate result after filtering. For this you can use the `all()` function.

// Search for several things at once
users.stream(function (doc, meta) {
return doc.age > 18 && doc.age < 40;
}, function (err, docs, metas) {
if (err) throw err;
// Do something with the results
});


## Removing a document

Remove is by key only.
Expand Down

0 comments on commit fb99d78

Please sign in to comment.