How to use “q” module for refactoring mongoose code?

后端 未结 5 478
野趣味
野趣味 2020-12-31 04:30

I\'m using mongoose to insert some data into mongodb. The code looks like:

var mongoose = require(\'mongoose\');
mongoose.connect(\'mongo://localhost/test\')         


        
5条回答
  •  时光说笑
    2020-12-31 05:01

    Today we have mongoose-q as well. A plugin to mongoose that gives you stuff like execQ and saveQ which return Q promises.

提交回复
热议问题