Answer the question
In order to leave comments, you need to log in
Why doesn't mongodb return more than 100 records?
Tell me why the query does not want to be executed if the table has more than 100 records, if 100 or less, everything is ok.
db.collection('allowedmacs').find().toArray(function(err, docs) {
console.log(docs);
}
Answer the question
In order to leave comments, you need to log in
You need to use cursor here.
var findMacs = function(db, callback) {
var cursor =db.collection('allowedmacs').find( );
cursor.each(function(err, doc) {
assert.equal(err, null);
if (doc != null) {
console.dir(doc);
} else {
callback();
}
});
};
MongoClient.connect(url, function(err, db) {
assert.equal(null, err);
findMacs(db, function() {
db.close();
});
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question