Closed ZhaoKunLong closed 1 year ago
Try await this.model.create([fields], { autopopulate: false });
. In Mongoose, Model.create(o1, o2)
creates 2 objects o1, o2. If you want to pass options to create, you should pass array as first param. See the Model.create docs
Oh!! @vkarpov15 Nice thanks for your reply! It really helped!
How to disable auto populate when create.
I'm doing this to create a doc
Then in
debugger
I found it will auto populate when the create.So I try to do like this
but it shows me this type issue
Is any one know how to resolve it?