Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const findDocuments = function(db, callback) {
- // Koleksiyon, db objesinden alınır
- const collection = db.collection('employees');
- // Id'si 3 olan kayıtı arama işlemi için: collection.find({ id: 3})
- // Tüm kayıtları listelemek: collection.find({}) şeklinde kullanabilirsiniz.
- collection.find({}).toArray(function(err, docs) {
- if(err) throw err;
- console.log("Şu kayıtlar bulunmuştur;");
- console.log(docs);
- callback(docs);
- });
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement