Skip to content

Instantly share code, notes, and snippets.

@nihaux
Created January 20, 2015 18:17
Show Gist options
  • Save nihaux/20e69c5c40fe1faad2c1 to your computer and use it in GitHub Desktop.
Save nihaux/20e69c5c40fe1faad2c1 to your computer and use it in GitHub Desktop.
ThemeDoc.collection.find({_id: mongoose.Types.ObjectId(themeId)}, {}, {'limit': 1}).toArray(function (err, themes) {
//console.log(themes);
if (themes.length == 1) {
QuestionDoc.collection.find({'theme': mongoose.Types.ObjectId(themeId)}, {}, {'limit': 3}).toArray(function(err, questions) {
//console.log(questions);
if(questions.length == 3) {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment