Package ai.tock.shared
Class MongosKt
-
- All Implemented Interfaces:
public final class MongosKt
-
-
Field Summary
Fields Modifier and Type Field Description private final static CountOptionsdefaultCountOptions
-
Method Summary
Modifier and Type Method Description final CountOptionsgetDefaultCountOptions()By default, do not count more than 1000000 documents (for large databases) 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 ObjecttransformData(Object data)Transform json data to prevent AWS DocumentDB field name restrictions Amazon DocumentDB does not support dots “. 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) final static <T extends Any> AggregateIterable<T>safeCollation(AggregateIterable<T> $self, Collation collation)-
-
Method Detail
-
getDefaultCountOptions
final CountOptions getDefaultCountOptions()
By default, do not count more than 1000000 documents (for large databases)
-
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()
-
transformData
final static Object transformData(Object data)
Transform json data to prevent AWS DocumentDB field name restrictions Amazon DocumentDB does not support dots “.” in a document field name
-
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)
-
safeCollation
final static <T extends Any> AggregateIterable<T> safeCollation(AggregateIterable<T> $self, Collation collation)
-
-
-
-