Mongoose create multiple documents

后端 未结 4 909
粉色の甜心
粉色の甜心 2020-12-29 19:39

I know in the latest version of Mongoose you can pass multiple documents to the create method, or even better in my case an array of documents.

var array = [         


        
4条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-29 20:29

    According to this ticket on GitHub, Mongoose 3.9 and 4.0 will return an array if you supply an array and a spread of arguments if you supply a spread when using create().

提交回复
热议问题