Mixin: insert

insert

This mixin provides insert() and save() methods.
Source:

Example

var opts = {
  storage: 'memory',
  primary_key: '_id' // primary key like MongoDB does
};
var collection = new KagoDB(opts);

var items = [
  { name: 'Apple' },
  { name: 'Orange' },
  { name: 'Grape' }
};

collection.insert(items, function(err) {
  console.log(err || 'no error'); // bulk insert
});