Last active

Embed URL

HTTPS clone URL

SSH clone URL

You can clone with HTTPS or SSH.

Download Gist
View methods.coffee
1 2 3 4 5 6 7 8 9 10 11 12 13
add: (doc, cb = ()-> true) ->
unless "_id" of doc
@db.post doc, cb
else if "_id" of doc and doc._id.slice(0,8) != "_design/"
@db.put doc, cb
else if doc.length
@db.bulkDocs doc, cb
get: (id, cb = ()-> true) ->
@db.get id, cb
remove: (id, cb = ()-> true) ->
@get id, (err, doc) =>
@db.remove doc, cb unless err
cb("err") if err
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.