Created
July 15, 2015 18:54
-
-
Save RichardLitt/48a6068c4edbba4f58ac to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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