Something went wrong. Try again.
The next MongoDB driver for Kotlin ktmongo.opensavvy.dev
kotlin mongodb multiplatform
Something went wrong. Try again.
1.6 kB · 49 lines
Kotlin
at main
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950/* * Copyright (c) 2026, OpenSavvy and contributors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */
package opensavvy.ktmongo.sync.api.operations
import opensavvy.ktmongo.dsl.command.CollectionInfoimport opensavvy.ktmongo.dsl.command.ListCollectionsOptionsimport opensavvy.ktmongo.dsl.query.FilterQueryimport opensavvy.ktmongo.sync.api.MongoIterable
/** * Interface grouping MongoDB operations relating to database administration. */interface DatabaseOperations : BaseOperations {
/** * Lists the collections in this database. * * ### Example * * ```kotlin * database.collections().forEach { * println("${it.name}") * } * ``` * * ### External resources * * - [Protocol documentation](https://www.mongodb.com/docs/manual/reference/command/listcollections) * - [`mongosh` documentation](https://www.mongodb.com/docs/manual/reference/method/db.getcollectioninfos) */ fun collections( options: ListCollectionsOptions.() -> Unit = {}, filter: FilterQuery<CollectionInfo>.() -> Unit = {}, ): MongoIterable<CollectionInfo>}