search

Home  >  Q&A  >  body text

node.js - mongoose怎么传递一段代码段到mongoodb?

比如

var a = db.collection.find();
var b = [];
a.forEach(item=> {
    if (item.name == 1)
        b.push(item)
});
b;

有一个处理比较复杂的语句代码段,mongoose怎么传递这段代码段到mongoodb?

伊谢尔伦伊谢尔伦2768 days ago432

reply all(1)I'll reply

  • 阿神

    阿神2017-04-17 15:26:22

    What is your intention? Looking at your code, you only need to process it in the callback after querying the value

    reply
    0
  • Cancelreply