Mongoose: CastError: Cast to ObjectId failed for value “[object Object]” at path “_id”

前端 未结 13 2070
再見小時候
再見小時候 2020-11-30 01:24

I am new to node.js, so I have a feeling that this will be something silly that I have overlooked, but I haven\'t been able to find an answer that fixes my problem. What I\'

13条回答
  •  情歌与酒
    2020-11-30 02:12

    My solution is that i want data from all docs and i dont want _id, so

    User.find({}, {_id:0, keyToShow:1, keyToNotShow:0})
    

提交回复
热议问题