nodejs - mongodb native find all documents

前端 未结 4 2063
迷失自我
迷失自我 2020-12-30 08:14

Following an example from the mongodb manual for nodejs, I am finding all documents from a db as follows

mongo.Db.connect(mongoUri, function (err, db) {
             


        
4条回答
  •  长发绾君心
    2020-12-30 08:43

    Would limiting the query be an option? Literally with db.collection.find().limit()? The limit is parsed before sending the command to the server, so it only scans the amount of data in your limit.

提交回复
热议问题