Skip to content

Commit

Permalink
added a bit of documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
jeromegn committed Dec 20, 2011
1 parent 5898451 commit ea020ba
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions README.md
Expand Up @@ -419,6 +419,11 @@ argument. For example:
connect().find("posts").reduce ((total, post)-> total + post.body.length), (error, total)->
console.log "Wrote #{total} characters"

You can call `update` with three arguments, the first is the updated document (don't forget $set if you don't want to replace the found document(s)), the second is the options for your update (`multi` and `upsert`, both default to false). Last argument is the callback as always, returns an error if any, but nothing else.

posts.where({permalink: {$exists: false}}).update {$set: {permalink: linkGenerator(post)}}, {multi: true} (error)->
console.log "All posts without permalinks now got some link love."


### Cursors

Expand Down

0 comments on commit ea020ba

Please sign in to comment.