import {insert, find} from 'in-mem';
const personA = insert('person', {firstname:'Ahmed'});
find(personA.id) // {id: '...',firstname:"Ahmed", dateCreated: "2017-02-12T07:24:57.612Z"}
Insert data in in-memory database.
(String)
Table Name of database
(Object)
it can be one of multiple records (overloaded function)
(Object | Array)
:
the data itself with new attributes which are "id" and "dateCreated"
const {insert} = require('in-mem');
insert('person', {firstname: "Ahmed", birth: new Date("1991/10/12")});
insert('product', {name: "مراعي"}, {name: "iPhone"});