varMongoDBCache=require('mdb-cache');varmdbCache=newMongoDBCache({uri: 'mongodb://127.0.0.1:27017/data-cache-db',//defaultcollection: 'mdb-cache',//defaultconnectionOptions: {},idFeild: '_id'//default, stands for feild name of 'key' in mongodb});//return a promise resolve the value, //can pass in a function as second parameter that check the vadality of the value,//and if function return true, value will be deleted, and get promise will resolve null;mdbCache.get(key,invalid);//return a promise that indicates successfully 'set' if fulfilledmdbCache.set(key,value);//return a promise that indicates successfully 'delete a key-value' if fulfilledmdbCache.del(key);//close connection;mdbCache.close();// register an error handlermdbCache.onError(onErrorHandler);