Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const insertDocuments = function(db, callback) {
- // Koleksiyon, db objesinden alınır
- const collection = db.collection('employees');
- // Koleksiyona çoklu ekleme işlemi
- collection.insertMany([
- { id: 1, adi: 'Ahmet', soyadi: 'Çınar', yas: 25 },
- { id: 2, adi: 'Caner', soyadi: 'Sarı', yas: 30 },
- { id: 3, adi: 'Gülçin', soyadi: 'Yılmaz', yas: 22 }
- ], function(err, result) {
- if(err) throw err;
- console.log("Koleksiyona 3 döküman eklenmiştir.");
- callback(result);
- });
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement