Skip to content

Instantly share code, notes, and snippets.

@vivalalova
Last active November 15, 2016 15:57
Show Gist options
  • Select an option

  • Save vivalalova/369d36d29a0ef77eab29827e5d15a9b9 to your computer and use it in GitHub Desktop.

Select an option

Save vivalalova/369d36d29a0ef77eab29827e5d15a9b9 to your computer and use it in GitHub Desktop.
Client.aggregate([{
"$lookup": {
"from": "badge",
"localField": "clientID",
"foreignField": "clientID",
"as": "test"
}
}]).exec(function(err, results) {
res.set({
'Content-Type': 'application/json',
'Content-Length': results.length,
});
res.send(JSON.stringify(results));
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment