Skip to content

Instantly share code, notes, and snippets.

@mikeymckay
Created January 30, 2018 20:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mikeymckay/dbc535cf96d5cd7d1e967dc2787bc602 to your computer and use it in GitHub Desktop.
Save mikeymckay/dbc535cf96d5cd7d1e967dc2787bc602 to your computer and use it in GitHub Desktop.
show all available revisions
db = new PouchDB()
user = "user.mmckay"
db.get user,
revs_info: true
.then (result) ->
availableRevs = _(result._revs_info).chain().filter (rev) ->
rev.status is "available"
.pluck("rev").value()
_(availableRevs).each (rev) ->
db.get user,
rev: rev
.then (result) ->
console.log result
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment