import { Database } from "https://deno.land/x/aloedb@0.9.0/mod.ts";
Constructors
new
Database(config?: Partial<DatabaseConfig> | string)Create database collection to store documents.
Type Parameters
optional
Schema extends Acceptable<Schema> = DocumentProperties
documents: Schema[]
In-Memory documents storage.
WARNING: It is better not to modify these documents manually, as the changes will not pass the necessary checks.
However, if you modify storage manualy, call the method await db.save()
to save your changes.
Methods
deleteMany(query?: Query<Schema> | QueryFunction<Schema>): Promise<Schema[]>
Deletes all documents that matches the search query.
save(): Promise<void>
Write documents to the database storage file.
Called automatically after each insert, update or delete operation. (Only if autosave
mode enabled)
updateMany(query: Query<Schema> | QueryFunction<Schema>, update: Update<Schema> | UpdateFunction<Schema>): Promise<Schema[]>
Modifies all documents that match search query.
updateOne(query: Query<Schema> | QueryFunction<Schema>, update: Update<Schema> | UpdateFunction<Schema>): Promise<Schema | null>
Modifies an existing document that match search query.