import { Collection } from "https://deno.land/x/kvdex@v0.18.4/mod.ts";
Represents a collection of documents stored in the KV store.
Contains methods for working on documents in the collection.
Constructors
Type Parameters
Properties
Methods
Set a document entry in the KV store.
Adds a new document to the KV store with a randomely generated id.
Deletes multiple documents from the KV store according to the given options.
If no options are given, all documents are deleted.
Add data to the collection queue to be delivered to the queue listener
via db.collection.listenQueue()
. The data will only be received by queue
listeners on the specified collection and topic. The method takes an optional options
argument that can be used to set a delivery delay and topic.
Finds multiple documents with the given array of ids in the KV store.
Find an undelivered document entry by id from the collection queue.
Executes a callback function for every document according to the given options.
If no options are given, the callback function is executed for all documents in the collection.
Retrieves multiple documents from the KV store according to the given options.
If no options are given, all documents are retrieved.
Listen for data from the collection queue that was enqueued with db.collection.enqueue()
.
Will only receive data that was enqueued to the specific collection queue.
Takes a handler function as argument.
Executes a callback function for every document according to the given options.
If no options are given, the callback function is executed for all documents in the collection.
The results from the callback function are returned as a list.
Updates a document with the given id in the KV store.
For primitive values, arrays and built-in objects, this method overrides the old value with the new one.
For custom object types, this method merges the new data with the exisiting data.
Update the value of multiple existing documents in the collection.
Write a document to the KV store.
Sets a new document entry if no matching id already exists, overwrites the exisiting entry if it exists.
Does not overwrite existing entries if there is a primary index collision.