JvmMongoCollection

Implementation of MongoCollection based on MongoDB's MongoCollection.

To access the inner iterable, see asKotlinClient.

To convert an existing MongoDB iterable into an instance of this class, see asKtMongo.

Properties

Link copied to clipboard

Functions

Link copied to clipboard

Start an aggregation pipeline.

Link copied to clipboard
fun asKotlinClient(): MongoCollection<Document>
Link copied to clipboard
open override fun bulkWrite(options: BulkWriteOptions<Document>.() -> Unit, filter: FilterQuery<Document>.() -> Unit, operations: BulkWrite<Document>.() -> Unit)

abstract fun bulkWrite(options: ERROR CLASS: Symbol not found for BulkWriteOptions<Document>.() -> Unit, filter: ERROR CLASS: Symbol not found for FilterQuery<Document>.() -> Unit, operations: ERROR CLASS: Symbol not found for BulkWrite<Document>.() -> Unit)

Performs multiple update operations in a single request.

Link copied to clipboard
open override fun count(): Long

Counts how many documents exist in the collection.

open override fun count(options: CountOptions<Document>.() -> Unit, predicate: FilterQuery<Document>.() -> Unit): Long

abstract fun count(options: ERROR CLASS: Symbol not found for CountOptions<Document>.() -> Unit, predicate: ERROR CLASS: Symbol not found for FilterQuery<Document>.() -> Unit): Long

Counts how many documents match predicate in the collection.

Link copied to clipboard
open override fun countEstimated(): Long

Counts all documents in the collection.

Link copied to clipboard
open override fun deleteMany(options: DeleteManyOptions<Document>.() -> Unit, filter: FilterQuery<Document>.() -> Unit)

abstract fun deleteMany(options: ERROR CLASS: Symbol not found for DeleteManyOptions<Document>.() -> Unit, filter: ERROR CLASS: Symbol not found for FilterQuery<Document>.() -> Unit)

Deletes all documents that match filter.

Link copied to clipboard
open override fun deleteOne(options: DeleteOneOptions<Document>.() -> Unit, filter: FilterQuery<Document>.() -> Unit)

abstract fun deleteOne(options: ERROR CLASS: Symbol not found for DeleteOneOptions<Document>.() -> Unit, filter: ERROR CLASS: Symbol not found for FilterQuery<Document>.() -> Unit)

Deletes the first document found that matches filter.

Link copied to clipboard
open override fun drop(options: DropOptions<Document>.() -> Unit)

abstract fun drop(options: ERROR CLASS: Symbol not found for DropOptions<Document>.() -> Unit)

Removes an entire collection from the database.

Link copied to clipboard
fun <Document : Any> MongoCollection<Document>.filter(filter: ERROR CLASS: Symbol not found for FilterQuery<Document>.() -> Unit): MongoCollection<Document>

Returns a filtered collection that only contains the elements that match filter.

Link copied to clipboard
open override fun find(): JvmMongoIterable<Document>

Finds all documents in this collection.

open override fun find(options: FindOptions<Document>.() -> Unit, filter: FilterQuery<Document>.() -> Unit): JvmMongoIterable<Document>

abstract fun find(options: ERROR CLASS: Symbol not found for FindOptions<Document>.() -> Unit, filter: ERROR CLASS: Symbol not found for FilterQuery<Document>.() -> Unit): MongoIterable<Document>

Finds all documents in this collection that satisfy filter.

Link copied to clipboard
open fun findOne(options: ERROR CLASS: Symbol not found for FindOptions<Document>.() -> Unit, filter: ERROR CLASS: Symbol not found for FilterQuery<Document>.() -> Unit): Document?

Finds a document in this collection that satisfies filter.

Link copied to clipboard
open override fun findOneAndUpdate(options: UpdateOptions<Document>.() -> Unit, filter: FilterQuery<Document>.() -> Unit, update: UpdateQuery<Document>.() -> Unit): Document?

abstract fun findOneAndUpdate(options: ERROR CLASS: Symbol not found for UpdateOptions<Document>.() -> Unit, filter: ERROR CLASS: Symbol not found for FilterQuery<Document>.() -> Unit, update: ERROR CLASS: Symbol not found for UpdateQuery<Document>.() -> Unit): Document?

Updates one element that matches filter according to update and returns it, atomically.

Link copied to clipboard
open override fun insertMany(documents: Iterable<Document>, options: InsertManyOptions<Document>.() -> Unit)

open fun insertMany(vararg documents: Document, options: ERROR CLASS: Symbol not found for InsertManyOptions<Document>.() -> Unit)
abstract fun insertMany(documents: Iterable<Document>, options: ERROR CLASS: Symbol not found for InsertManyOptions<Document>.() -> Unit)

Inserts multiple documents in a single operation.

Link copied to clipboard
open override fun insertOne(document: Document, options: InsertOneOptions<Document>.() -> Unit)

abstract fun insertOne(document: Document, options: ERROR CLASS: Symbol not found for InsertOneOptions<Document>.() -> Unit)

Inserts a document.

Link copied to clipboard
open override fun replaceOne(options: ReplaceOptions<Document>.() -> Unit, filter: FilterQuery<Document>.() -> Unit, document: Document)

abstract fun replaceOne(options: ERROR CLASS: Symbol not found for ReplaceOptions<Document>.() -> Unit, filter: ERROR CLASS: Symbol not found for FilterQuery<Document>.() -> Unit, document: Document)

Replaces a document that matches filter by document.

Link copied to clipboard
open override fun repsertOne(options: ReplaceOptions<Document>.() -> Unit, filter: FilterQuery<Document>.() -> Unit, document: Document)

abstract fun repsertOne(options: ERROR CLASS: Symbol not found for ReplaceOptions<Document>.() -> Unit, filter: ERROR CLASS: Symbol not found for FilterQuery<Document>.() -> Unit, document: Document)

Replaces a document that matches filter by document.

Link copied to clipboard
open override fun toString(): String
Link copied to clipboard
open override fun updateMany(options: UpdateOptions<Document>.() -> Unit, filter: FilterQuery<Document>.() -> Unit, update: UpdateQuery<Document>.() -> Unit)

abstract fun updateMany(options: ERROR CLASS: Symbol not found for UpdateOptions<Document>.() -> Unit, filter: ERROR CLASS: Symbol not found for FilterQuery<Document>.() -> Unit, update: ERROR CLASS: Symbol not found for UpdateQuery<Document>.() -> Unit)

Updates all documents that match filter according to update.

Link copied to clipboard
open override fun updateManyWithPipeline(options: UpdateOptions<Document>.() -> Unit, filter: FilterQuery<Document>.() -> Unit, update: UpdateWithPipelineQuery<Document>.() -> Unit)

abstract fun updateManyWithPipeline(options: ERROR CLASS: Symbol not found for UpdateOptions<Document>.() -> Unit, filter: ERROR CLASS: Symbol not found for FilterQuery<Document>.() -> Unit, update: ERROR CLASS: Symbol not found for UpdateWithPipelineQuery<Document>.() -> Unit)

Updates all documents that match filter according to the update pipeline.

Link copied to clipboard
open override fun updateOne(options: UpdateOptions<Document>.() -> Unit, filter: FilterQuery<Document>.() -> Unit, update: UpdateQuery<Document>.() -> Unit)

abstract fun updateOne(options: ERROR CLASS: Symbol not found for UpdateOptions<Document>.() -> Unit, filter: ERROR CLASS: Symbol not found for FilterQuery<Document>.() -> Unit, update: ERROR CLASS: Symbol not found for UpdateQuery<Document>.() -> Unit)

Updates a single document that matches filter according to update.

Link copied to clipboard
open override fun updateOneWithPipeline(options: UpdateOptions<Document>.() -> Unit, filter: FilterQuery<Document>.() -> Unit, update: UpdateWithPipelineQuery<Document>.() -> Unit)

abstract fun updateOneWithPipeline(options: ERROR CLASS: Symbol not found for UpdateOptions<Document>.() -> Unit, filter: ERROR CLASS: Symbol not found for FilterQuery<Document>.() -> Unit, update: ERROR CLASS: Symbol not found for UpdateWithPipelineQuery<Document>.() -> Unit)

Updates a single document that matches filter according to the update pipeline.

Link copied to clipboard
open override fun upsertOne(options: UpdateOptions<Document>.() -> Unit, filter: FilterQuery<Document>.() -> Unit, update: UpsertQuery<Document>.() -> Unit)

abstract fun upsertOne(options: ERROR CLASS: Symbol not found for UpdateOptions<Document>.() -> Unit, filter: ERROR CLASS: Symbol not found for FilterQuery<Document>.() -> Unit, update: ERROR CLASS: Symbol not found for UpsertQuery<Document>.() -> Unit)

Updates a single document that matches filter according to update.

Link copied to clipboard
open override fun upsertOneWithPipeline(options: UpdateOptions<Document>.() -> Unit, filter: FilterQuery<Document>.() -> Unit, update: UpdateWithPipelineQuery<Document>.() -> Unit)

abstract fun upsertOneWithPipeline(options: ERROR CLASS: Symbol not found for UpdateOptions<Document>.() -> Unit, filter: ERROR CLASS: Symbol not found for FilterQuery<Document>.() -> Unit, update: ERROR CLASS: Symbol not found for UpdateWithPipelineQuery<Document>.() -> Unit)

Updates a single document that matches filter according to the update pipeline.