sql >> Base de Datos >  >> NoSQL >> MongoDB

Node.js + MongoDB:MongoError:cursor eliminado o agotado

Según Documento oficial de Mongodb , el parámetro opcional timeout se puede establecer en false .

db.collection('mycollection').find({}, {timeout:false}, function(err, cursor) {
    if (!err) {
         // Iterate safely on your cursor here
    } else {
        console.log(err);
    }
});