MongoQueryIndex

data class MongoQueryIndex(val context: String, val aggregate: String, val name: String, val keys: List<String>, val collection: String = MongoSnapshotStore.collectionName(context, aggregate), partial: Document? = MongoSnapshotStore.notDeleted(), val sparse: Boolean = false)

A planned query index of aggregate in context: its name, unique within its collection, and its keys in order, each ascending, over the documents its partial filter keeps: on the snapshot collection, the snapshots that are not deleted; on the log collection (MongoQueryIndexes.planLog), the streams. A sparse one has no partial filter and holds the documents that have its key: a built-in access attribute's tenant-scoped key on a log.

Constructors

Link copied to clipboard
constructor(context: String, aggregate: String, name: String, keys: List<String>, collection: String = MongoSnapshotStore.collectionName(context, aggregate), partial: Document? = MongoSnapshotStore.notDeleted(), sparse: Boolean = false)

Properties

Link copied to clipboard
Link copied to clipboard

The collection the index is on: the aggregate's snapshot collection by default.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Whether the index holds only the documents that have its key, with no partial filter.

Functions

Link copied to clipboard
fun keyDocument(): Document

The key document of the index: {tenant_id: 1, <key>: 1, ...}.

Link copied to clipboard
fun partialFilter(): Document?

The partial filter of the index: {deleted: false} on the snapshots, {version: {$exists: true}} on a log; none for a sparse one.

Link copied to clipboard
open override fun toString(): String

The createIndexes specification of the index, as listIndexes reports it.