ListCollectionNamesIterable

class ListCollectionNamesIterable(wrapped: ListCollectionNamesIterable) : MongoIterable<String>

Iterable for listing collection names.

Since

5.0

See also

Constructors

Link copied to clipboard
constructor(wrapped: ListCollectionNamesIterable)

Functions

Link copied to clipboard

Sets the authorizedCollections field of the listCollections command.

Link copied to clipboard
open override fun batchSize(batchSize: Int): ListCollectionNamesIterable

Sets the number of documents to return per batch.

Link copied to clipboard
fun comment(comment: BsonValue?): ListCollectionNamesIterable

Sets the comment for this operation. A null value means no comment is set.

Link copied to clipboard

Returns a cursor used for iterating over elements of type `T. The cursor is primarily used for change streams.

Link copied to clipboard

Sets the query filter to apply to the returned database names.

Link copied to clipboard
fun first(): String
Link copied to clipboard
Link copied to clipboard
fun forEach(action: (String) -> Unit)

Performs the given action on each element and safely closes the cursor.

Link copied to clipboard
fun <R> map(transform: (String) -> R): MongoIterable<R>

Maps this iterable from the source document type to the target document type.

Link copied to clipboard
fun maxTime(maxTime: Long, timeUnit: TimeUnit = TimeUnit.MILLISECONDS): ListCollectionNamesIterable

Sets the maximum execution time on the server for this operation.

Link copied to clipboard
fun <C : MutableCollection<in String>> toCollection(destination: C): C

Appends all elements to the given destination collection.

Link copied to clipboard
Link copied to clipboard
fun <R> use(consumer: (Sequence<String>) -> R): R

Creates a new cursor and treats it as a Sequence, invokes the given consumer function and closes the cursor down correctly whether an exception is thrown or not.