-
- All Implemented Interfaces:
public final class MongosKt
-
-
Method Summary
Modifier and Type Method Description final static MongoDatabasegetDatabase(String databaseNameProperty)Return the sync database specified in the databaseNameProperty. final static MongoDatabasegetAsyncDatabase(String databaseNameProperty)Return the async database specified in the databaseNameProperty. final static <T extends Any> Unitwatch(MongoCollection<T> $self, FullDocument fullDocument, Function1<ChangeStreamDocument<T>, Unit> listener)final static <T extends Any> StringensureIndex(MongoCollection<T> $self, KProperty<?> properties, IndexOptions indexOptions)final static <T extends Any> StringensureIndex(MongoCollection<T> $self, Bson keys, IndexOptions indexOptions)final static <T extends Any> StringensureIndex(MongoCollection<T> $self, String keys, IndexOptions indexOptions)final static <T extends Any> StringensureUniqueIndex(MongoCollection<T> $self, KProperty<?> properties, IndexOptions indexOptions)final static BooleanisDocumentDB()final static BooleanpingMongoDatabase(String databaseName)final static <T extends Any> FindIterable<T>safeCollation(FindIterable<T> $self, Collation collation)Set collation if database supports it (ie not with DocumentDB) -
-
Method Detail
-
getDatabase
final static MongoDatabase getDatabase(String databaseNameProperty)
Return the sync database specified in the databaseNameProperty. if the env or system property is not found, use the databaseNameProperty as database name (remove "_mongo_db" string is present).
-
getAsyncDatabase
final static MongoDatabase getAsyncDatabase(String databaseNameProperty)
Return the async database specified in the databaseNameProperty. if the env or system property is not found, use the databaseNameProperty as database name (remove "_mongo_db" string is present).
-
watch
final static <T extends Any> Unit watch(MongoCollection<T> $self, FullDocument fullDocument, Function1<ChangeStreamDocument<T>, Unit> listener)
-
ensureIndex
final static <T extends Any> String ensureIndex(MongoCollection<T> $self, KProperty<?> properties, IndexOptions indexOptions)
-
ensureIndex
final static <T extends Any> String ensureIndex(MongoCollection<T> $self, Bson keys, IndexOptions indexOptions)
-
ensureIndex
final static <T extends Any> String ensureIndex(MongoCollection<T> $self, String keys, IndexOptions indexOptions)
-
ensureUniqueIndex
final static <T extends Any> String ensureUniqueIndex(MongoCollection<T> $self, KProperty<?> properties, IndexOptions indexOptions)
-
isDocumentDB
final static Boolean isDocumentDB()
-
pingMongoDatabase
final static Boolean pingMongoDatabase(String databaseName)
-
safeCollation
final static <T extends Any> FindIterable<T> safeCollation(FindIterable<T> $self, Collation collation)
Set collation if database supports it (ie not with DocumentDB)
-
-
-
-