const Q = require('./q'),
    nedbCollection = require('nedbCollection'),
    taskStatus = require('taskStatus');
class loacl {
    constructor() {
        this.nedb = new nedbCollection('loacl.d');
    }
    count() {
        return this.nedb.count();
    }
    remove(_id) {
        return this.nedb.delete({ '_id': _id });
    }
    clear() {
        return this.nedb.delete({});
    }
    find(selector) {
        return this.nedb.find(selector,{ ctime: -1 });
    }
    add(datas) {
        if (!datas || (Array.isArray(datas) && !datas.length))
            return Q((resolve, reject) => { resolve(false); });
        return this.nedb.insert(datas);
    }
}
module.exports = loacl;