SHARE
TWEET

Untitled

a guest Aug 21st, 2019 60 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const insertDocuments = function(db, callback) {
  2.     // Koleksiyon, db objesinden alınır
  3.     const collection = db.collection('employees');
  4.    
  5.     // Koleksiyona çoklu ekleme işlemi
  6.     collection.insertMany([
  7.         { id: 1, adi: 'Ahmet', soyadi: 'Çınar', yas: 25 },
  8.         { id: 2, adi: 'Caner', soyadi: 'Sarı', yas: 30 },
  9.         { id: 3, adi: 'Gülçin', soyadi: 'Yılmaz', yas: 22 }
  10.     ], function(err, result) {
  11.         if(err) throw err;
  12.        
  13.         console.log("Koleksiyona 3 döküman eklenmiştir.");
  14.        
  15.         callback(result);
  16.     });
  17. };
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top