Skip to content

Instantly share code, notes, and snippets.

@RichardLitt
Created July 15, 2015 18:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save RichardLitt/48a6068c4edbba4f58ac to your computer and use it in GitHub Desktop.
Save RichardLitt/48a6068c4edbba4f58ac to your computer and use it in GitHub Desktop.
module.exports.getConversationsForUser = function (user, cb) {
db.query(function (doc) {
if (doc.author === user.userId) {
emit(doc)
}
}.bind(this), {include_docs: true}).then(function (response) {
console.log('response', response)
cb(null, response)
}).catch(function (err) {
cb(err)
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment