The connected NEDB database instance
A batched version of getLinkedRemoteRooms
.
A mapping of room_id to RemoteRoom.
Convenience method to convert a document to something.
The function which will be called with a single document object. Guaranteed not to be null.
A transformFn
function to pass to the standard
select/delete/upsert/etc methods.
DELETE multiple documents.
Get a list of entries based on the link's data value.
The data values to retrieve based from.
Get a list of entries based on the matrix_id of each entry.
A batch version of getEntriesByMatrixId
.
Resolves to a map of room_id => Entry[]
Get a list of entries based on a MatrixRoom data value.
The data values to retrieve based from.
Get a list of entries based on the remote_id of each entry.
Get a list of entries based on a RemoteRoom data value.
The data values to retrieve based from.
Get an existing entry based on the provided entry ID.
The ID of the entry to retrieve.
Get all entries with the given remote_id which have a Matrix room within.
Get all entries with the given matrix_id which have a Remote room within.
Get an entry's Matrix room based on the provided room_id. The entry MUST have an 'id' of the room_id and there MUST be a Matrix room contained within the entry for this to return.
INSERT a multiple documents.
INSERT IF NOT EXISTS a single document
Create a link between a matrix room and remote room. This will create an entry with:
The matrix room
The remote room
Information about this mapping.
The id value to set. If not given, a unique ID will be created from the matrix_id and remote_id.
Remove entries based on the link's data value.
The data to match.
Remove entries based on matrix room data.
The data to match.
Remove entries with this matrix room id.
The matrix id.
Remove entries based on remote room data.
The data to match.
Remove entries with this remote room id.
The remote id.
Remove an existing entry based on the provided entry ID.
The ID of the entry to remove.
SELECT a number of documents.
SELECT a single document.
Create an entry with only a matrix room. Sets the 'id' of the entry to the Matrix room ID. If an entry already exists with this 'id', it will be replaced. This function is useful if you just want to store a room with some data and not worry about any mappings.
Set a UNIQUE key constraint on the given field.
The field name. Use dot notation for nested objects.
Allow sparse entries (undefined won't cause a key violation).
UPDATE a single document. If the document already exists, this will NOT update it.
UPSERT a single document
Insert an entry, clobbering based on the ID of the entry.
Generated using TypeDoc
Construct a store suitable for room bridging information. Data is stored as RoomBridgeStoreEntrys which have the following serialized format:
{ id: "unique_id", // customisable matrix_id: "room_id", remote_id: "remote_room_id", matrix: { serialised matrix room info }, remote: { serialised remote room info }, data: { ... any additional info ... } }
If a unique 'id' is not given, the store will generate one by concatenating the
matrix_id
and theremote_id
. The delimiter used is a property on this store and can be modified.The structure of Entry objects means that it is efficient to select based off the 'id', 'matrix_id' or 'remote_id'. Additional indexes can be added manually.