type Query = Array; /** * database adapter interface for retrieve entities */ export interface IAdapter { /** * insert a record */ insert(record: T): PromiseLike; /** * get number of matches for the query */ count(query, options?): PromiseLike; // bulkInsert(record:T[]):PromiseLike; get(id:string|number): PromiseLike; /** * find out all the matched records */ find(query, option?): PromiseLike; /** * find the first matched record */ findOne(query, option?): PromiseLike; /** * update all the matched records */ update(query, operations, options?): PromiseLike; /** * remove all the matched records */ remove(query, options?): PromiseLike; }