@brontosaurus/db
Version:
:ocean: Schema for brontosaurus
16 lines (15 loc) • 1.28 kB
TypeScript
import { ObjectID } from "bson";
import { IRecord, IRecordConfig, RecordCategory } from "../interface/record";
import { IRecordModel } from "../model/record";
export declare const createUnsavedRecord: <C extends "ACCOUNT" = any, A extends keyof RecordCategory[C] = any>(config: IRecordConfig<C, A>) => IRecordModel<C, A>;
export declare const getRecordById: (id: ObjectID) => Promise<IRecordModel | null>;
export declare const getRecordByIdLean: (id: ObjectID) => Promise<IRecord | null>;
export declare const getRecordsByIds: (ids: ObjectID[]) => Promise<IRecordModel[]>;
export declare const getRecordsByIdsLean: (ids: ObjectID[]) => Promise<IRecord[]>;
export declare const getTotalRecordPages: (limit: number) => Promise<number>;
export declare const getAllRecords: () => Promise<IRecordModel[]>;
export declare const getAllRecordsLean: () => Promise<IRecord[]>;
export declare const getAllRecordsByPage: (limit: number, page: number) => Promise<IRecordModel[]>;
export declare const getAllRecordsByPageLean: (limit: number, page: number) => Promise<IRecord[]>;
export declare const getRecordsByQuery: (query: Record<string, any>) => Promise<IRecordModel[]>;
export declare const getDRecordsByQueryLean: (query: Record<string, any>) => Promise<IRecordModel[]>;