Mongoose always returning an empty array NodeJS

后端 未结 5 1126

I have tried using find and findOne and both are not returning a document. find is returning an empty array while findOne

5条回答
  •  感动是毒
    2020-11-22 10:40

    Simply inorder to avoid pluralization complexity use this:

    var Model = mongoose.model("Model", fileSchema, "pure name your db collection");
    

    It's very confusing.[at least for me.]

提交回复
热议问题