Created
December 2, 2014 18:06
-
-
Save bgvo/fdb9b6d521aea9148ddf to your computer and use it in GitHub Desktop.
querying inside foreach
This file contains 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
db.ratings.find().forEach(function(doc){ | |
var item = db.items.find({_id: doc.item_id}) | |
var ry = item.detail.ry | |
}) | |
ITEM | |
{ | |
"_id" : ObjectId("5461c8f0426f727f16000000"), | |
"n" : "The Shawshank Redemption", | |
"detail" : { | |
"ry": 1992 | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment