default
import { default } from "https://7smzlzo4lz2ivy7dcfbyll4asdkqtc62pbdit23ysj5xdlu6wsra.arweave.net/_JmV5dxedIrj4xFDha-AkNUJi9p4RonreJJ7ca6etKI/mod.ts";
the Model skeleton to be controlled at collection
interface default {
createdAt?: Date;
id?: string;
updatedAt?: Date;
}class default { }
private autosave: boolean;
private rootDir: string;
getCollectionNames();
save();
static drop(rootDir: string);
class default<T extends Document = Document> { }
private autosave: boolean;
private data: T[];
private fsPath: string;
deleteMany(options: T);
deleteOne(options: T);
find(options: T);
findOne(options: T);
insertMany(els: T[]);
insertOne(el: T);
save();
updateMany(options: T, el: T);
updateOne(options: T, el: T);
§Constructors
§Properties
§
collections: Record<string, Collection>
[src]§Methods
§
Get a collection
@param colName
Collection Name
@template T
a type extending Collection Model
@return
the specified collection
§Static Methods
§Constructors
§Properties
§Methods
§
deleteMany(options: T)
[src]Bulk delete
@param options
Filter conditions of documents
@return
the deleted document IDs
§
deleteOne(options: T)
[src]Delete a document
@param options
Filter conditions of documents
@return
the deleted document ID
§
find(options: T)
[src]Find some documents by using filter conditions
Caution! The method on this stage is only able to find documents with equals properties. For more options like greater than, less than or equal to, please wait for newer version
@param options
filter conditions
@return
the filtered documents
§
insertMany(els: T[])
[src]Bulk Insert
@param els
an array of documents to be inserted
@return
the inserted documents
§
insertOne(el: T)
[src]Insert a document
@param el
the document to be inserted
@return
the inserted document