Creates an instance of DatastoreOperations.
Function that returns the Datastore object.
An instance of LevelDB database.
Function that returns the type of a model.
The Datastore object that is parent of this object.
LevelDB database object.
Type of an object stored.
Converts a plain object to a class object. Uses class-transformer
.
Item to convert to a class object.
Object with type T
.
Converts a plain object to a class object, while also setting its general parameters.
Uses class-transformer
.
Item to convert to a class object and set its parameters.
Object with type T
.
Converts a class item to plain item. Uses class-transformer
.
Item to convert to plain object.
Plain object.
Gets the number of items that match the filter and are in range of your pagination data (skip, take). If none of those arguments are passed, returns the total number of objects in the database.
Filter object. Must be FilterOperator<T>
.
Pagination object. Must be PaginationData
.
The number of objects that match the filter and the pagination data.
Created a read stream on LevelDB database. onData
callback will be called on each object, and it contains
plain-object form of the object.
await this.createReadStream<T>(data => values.push(data))
Iterates through all objects with a set filter. Returns a ValueStream
instance.
Your filter object.
Deletes an item in the database.
Identifier of an object.
Gets all items that match the filter. Gets all of the items if no filter is given.
Filter object. Must be FilterOperator<T>
.
An array of objects that match the filter.
Gets an object based on its id.
Identifier of an object.
The object.
Gets all items that match the filter. Gets all of the items if no filter is given.
Returned items are not converted to a class object - they are still in a plain
object form. This method is faster than get()
.
Filter object. Must be FilterOperator<T>
.
An array of plain objects that match the filter.
Pushes an object to the database.
Object to push.
The object with its metadata field filled.
Updates an item in the database.
Identifier of an object. Same as item.meta.id
.
New data of the object.
The object with updated data.
Sets the created time of an item to current time.
Item to set parameters to.
Sets general parameters of an object, such as meta.id
and store
.
Item to set parameters to.
Identifier of an object.
Sets general parameters of an object when pushing,
such as meta.id
and store
, also meta.created
and meta.updated
.
Identifier of an object.
Item to set parameters to.
Sets the last updated time of an item to current time.
Item to set parameters to.
Generated using TypeDoc
This class contains some lower-level abstractions for the LevelDB.
Usage
You should not instantiate this class, consider using Datastore instead. After that, you can access this class through
datastore.methods
.