Skip to content Skip to sidebar Skip to footer

Why Mongodb Not Giving Me More Than 100 Documents?

Why does my query not working with more than 100 documents in collection? db.collection('allowedmacs').find().toArray(function(err, docs) { console.log(docs); } err says this: nam

Solution 1:

You're probably doing something like this:

db.collection('allowedmacs').find().toArray(function(err, docs) {
  console.log(docs);
});
db.close();

So you're closing the database before the callback to toArray has been called (although it may work on some occassions).

Instead, try this:

db.collection('allowedmacs').find().toArray(function(err, docs) {
  console.log(docs);
  db.close();
});

Solution 2:

in source there is written:

MongoDB supports no more than 100 levels of nesting for BSON documents.

maybe you look into : Mongo and find always limited to 100 with geo data

Post a Comment for "Why Mongodb Not Giving Me More Than 100 Documents?"