Mongoose JS queries all coming back null or empty

前端 未结 2 2031
别跟我提以往
别跟我提以往 2021-02-08 22:45

I am trying to create a simple MongooseJS example program that gets a list of items from a collection, and it\'s coming back empty every time. Here is the code:

         


        
2条回答
  •  南旧
    南旧 (楼主)
    2021-02-08 23:40

    While this is true, you can specify the name of the collection in the third argument and it will use the case from that string:

    var sampleCollection = mongoose.model('sampleCollection', sampleSchema,'SampleCollection');
    

提交回复
热议问题