阅读背景:

What is the best way to query mongodb with mongoose with an array of IDs?

来源:互联网 

I query one collection (messages) with mongoose. The result is an array of documents. Each document contains an ID for a different collection (users). Now I want to query the users collection for each ID from the messages collection. The idea is to update each message object with the information from the user collection before returning it to the front end. I tried using async.each. For some reason the final function is never called even though I am making sure the callback() function is called after each iteration.I query one collection (messages) with mongoose




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: