public
Last active

  • Download Gist
methods.coffee
CoffeeScript
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

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.