因为mongodb5.xx版本去掉了pushAll
https://github.com/Automattic/mongoose/blob/master/History.md
需要通过追加参数来支持pushAll
new mongoose.Schema({
username: String
}, {
usePushEach: true
});
因为mongodb5.xx版本去掉了pushAll
https://github.com/Automattic/mongoose/blob/master/History.md
需要通过追加参数来支持pushAll
new mongoose.Schema({
username: String
}, {
usePushEach: true
});