Collection
import { Collection } from "https://7smzlzo4lz2ivy7dcfbyll4asdkqtc62pbdit23ysj5xdlu6wsra.arweave.net/_JmV5dxedIrj4xFDha-AkNUJi9p4RonreJJ7ca6etKI/src/collection.ts";
A Collection to store data
class Collection<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
§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