UNPKG

@sinkingsheep/jsondb

Version:

A lightweight JSON-based database for Node.js

20 lines (19 loc) 575 B
import JsonDB from "./JsonDB"; import { Document, OperatorQuery } from "./types"; export declare class QueryChain<T extends Document = Document> { private db; private collectionName; private queryConditions; private sortConditions; private limitValue?; private skipValue?; constructor(db: JsonDB, collectionName: string); where(query: OperatorQuery): this; sort(sort: { [key: string]: 1 | -1; }): this; limit(limit: number): this; skip(skip: number): this; find(): Promise<T[]>; findOne(): Promise<T | null>; }