jdb-lite
Version:
A lightweight schema-based JSON database library with validation
32 lines • 1.29 kB
TypeScript
export declare class DatabaseManager {
private dbPath;
private collections;
constructor(dbPath?: string);
private ensureDbDirectory;
private getCollectionPath;
private loadCollection;
private saveCollection;
insertOne(collectionName: string, doc: any): Promise<any>;
insertMany(collectionName: string, docs: any[]): Promise<any[]>;
find(collectionName: string, filter?: any): Promise<any[]>;
findOne(collectionName: string, filter?: any): Promise<any | null>;
findById(collectionName: string, id: string): Promise<any | null>;
updateOne(collectionName: string, filter: any, update: any): Promise<{
modifiedCount: number;
}>;
updateMany(collectionName: string, filter: any, update: any): Promise<{
modifiedCount: number;
}>;
deleteOne(collectionName: string, filter: any): Promise<{
deletedCount: number;
}>;
deleteMany(collectionName: string, filter: any): Promise<{
deletedCount: number;
}>;
countDocuments(collectionName: string, filter?: any): Promise<number>;
dropCollection(collectionName: string): Promise<void>;
private matchesFilter;
ensureCollection(collectionName: string): void;
getCollectionNames(): string[];
}
//# sourceMappingURL=database.d.ts.map