Mongoose/MongoDB result fields appear undefined in Javascript

前端 未结 10 2258
囚心锁ツ
囚心锁ツ 2020-11-27 20:13

Is there something that I\'m missing that would allow item to log as an object with a parameter, but when I try to access that parameter, it\'s undefined?

What I\'ve

10条回答
  •  情深已故
    2020-11-27 20:36

    Make sure that you have defined title in your schema:

    var MyCollectionSchema = new mongoose.Schema({
        _id: String,
        title: String
    });
    

提交回复
热议问题