@imjxsx/localdb
Version:
A lightweight MongoDB-style BSON database for Node.js
17 lines • 758 B
TypeScript
import { IDocument } from "../types/index.js";
export declare class Collection<T extends IDocument> {
private documents;
constructor(store: Record<string, T>);
private matches;
insertOne(value: Omit<T, "__uuid" | "updatedAt" | "createdAt">): T;
insertMany(values: Omit<T, "__uuid" | "updatedAt" | "createdAt">[]): T[];
findOne(filter: Partial<T>): T | null;
find(filter?: Partial<T>): T[];
exists(filter: Partial<T>): boolean;
count(filter?: Partial<T>): number;
updateOne(filter: Partial<T>, update: Partial<T>): T | null;
updateMany(filter: Partial<T>, update: Partial<T>): number;
deleteOne(filter: Partial<T>): boolean;
deleteMany(filter: Partial<T>): number;
}
//# sourceMappingURL=collection.d.ts.map