Package-level declarations

Types

Link copied to clipboard

Builder used to construct a call defining serializers for the different arguments and return value.

Link copied to clipboard
data class UpdateManyResult(val modifiedCount: Long, val upsertedId: Any?)

Wrapper of results of an updateMany call.

Link copied to clipboard
data class UpdateOneResult(val updated: Boolean, val upsertedId: Any?)

Wrapper of results of an updateOne call.

Functions

Link copied to clipboard
inline suspend fun <T> MongoCollection<*>.aggregate(pipeline: List<BsonDocument>): List<T>

Execute an aggregate pipeline on the remote collection.

Link copied to clipboard
inline suspend fun <T> Functions.call(name: String, vararg args: Any?): T

Invokes an Atlas function.

inline suspend fun <T> Functions.call(name: String, callBuilderBlock: CallBuilder<T>.() -> Unit): T

Invokes an Atlas function using the EJson encoder defined in AppConfiguration.ejson.

Link copied to clipboard
@ExperimentalKBsonSerializerApi
inline fun <T : BaseRealmObject> MongoClient.collection(eJson: EJson? = null): MongoCollection<T>

Get a MongoCollection that exposes methods to retrieve and update data from the remote collection of objects of schema type T.

Link copied to clipboard
suspend fun MongoCollection<*>.count(filter: BsonDocument? = null, limit: Long? = null): Long

Returns the number of documents in the collection.

Link copied to clipboard
inline fun <T> User.customData(serializer: KSerializer<T> = (this as UserImpl).app.configuration.ejson.serializersModule.serializerOrRealmBuiltInSerializer()): T?

Returns the custom user data associated with the user in the Realm App as T.

Link copied to clipboard
inline fun User.customDataAsBsonDocument(): BsonDocument?

Return the custom user data associated with the user in the Realm App as BsonDocument.

Link copied to clipboard
suspend fun MongoCollection<*>.deleteMany(filter: BsonDocument): Long

Delete multiple objects from the remote collection.

Link copied to clipboard
suspend fun MongoCollection<*>.deleteOne(filter: BsonDocument): Boolean

Delete a single object from the remote collection.

Link copied to clipboard
inline suspend fun <T> MongoCollection<T>.find(filter: BsonDocument? = null, projection: BsonDocument? = null, sort: BsonDocument? = null, limit: Long? = null): List<T>

Retrieve multiple object from the remote collection.

Link copied to clipboard
inline suspend fun <T> MongoCollection<T>.findOne(filter: BsonDocument? = null, projection: BsonDocument? = null, sort: BsonDocument? = null): T?

Retrieve a single object from the remote collection.

Link copied to clipboard
inline suspend fun <T> MongoCollection<T>.findOneAndDelete(filter: BsonDocument, projection: BsonDocument? = null, sort: BsonDocument? = null): T?

Find and delete a single object in the remote collection.

Link copied to clipboard
inline suspend fun <T> MongoCollection<T>.findOneAndReplace(filter: BsonDocument, document: BsonDocument, projection: BsonDocument? = null, sort: BsonDocument? = null, upsert: Boolean = false, returnNewDoc: Boolean = false): T?

Find and replace or insert a single new object in the remote collection.

Link copied to clipboard
inline suspend fun <T> MongoCollection<T>.findOneAndUpdate(filter: BsonDocument, update: BsonDocument, projection: BsonDocument? = null, sort: BsonDocument? = null, upsert: Boolean = false, returnNewDoc: Boolean = false): T?

Find and update or insert a single new object in the remote collection.

Link copied to clipboard

Insert an AsymmetricRealmObject into Realm. Since asymmetric objects are "write-only", it is not possible to access the managed data after it has been inserted.

Insert a dynamic version of a AsymmetricRealmObject into a realm. Since asymmetric objects are "write-only", it is not possible to access the managed data after it has been inserted.

Link copied to clipboard
@JvmName(name = "insertManyTyped")
inline suspend fun <T : Any> MongoCollection<*>.insertMany(documents: Collection<T>): List<Any>

Insert a list of object into the remote collection.

Link copied to clipboard
inline suspend fun <T : Any> MongoCollection<T>.insertOne(document: T): Any

Insert a single object into the remote collection.

Link copied to clipboard
inline fun <T> User.profile(serializer: KSerializer<T> = (this as UserImpl).app.configuration.ejson.serializersModule.serializerOrRealmBuiltInSerializer()): T

Returns the profile for this user as a T.

Link copied to clipboard
inline fun User.profileAsBsonDocument(): BsonDocument

Returns the profile for this user as BsonDocument.

Link copied to clipboard
suspend fun <T : RealmObject> RealmQuery<T>.subscribe(mode: WaitForSync = WaitForSync.FIRST_TIME, timeout: Duration = Duration.INFINITE): RealmResults<T>
suspend fun <T : RealmObject> RealmResults<T>.subscribe(mode: WaitForSync = WaitForSync.FIRST_TIME, timeout: Duration = Duration.INFINITE): RealmResults<T>

Automatically create an anonymous Subscription from a local query result in the background and return the result of re-running the same query against the Realm file. This behaves the same as creating a named variant by calling subscribe. See this method for details about the exact behavior.

suspend fun <T : RealmObject> RealmQuery<T>.subscribe(name: String, updateExisting: Boolean = false, mode: WaitForSync = WaitForSync.FIRST_TIME, timeout: Duration = Duration.INFINITE): RealmResults<T>

Automatically create a named Subscription from a query in the background and return the result of running the same query against the local Realm file.

suspend fun <T : RealmObject> RealmResults<T>.subscribe(name: String, updateExisting: Boolean = false, mode: WaitForSync = WaitForSync.FIRST_TIME, timeout: Duration = Duration.INFINITE): RealmResults<T>

Automatically create a named Subscription from a local query result in the background and return the result of re-running the same query against the Realm file.

Link copied to clipboard
inline suspend fun MongoCollection<*>.updateMany(filter: BsonDocument, update: BsonDocument, upsert: Boolean = false): UpdateManyResult

Update multiple objects or insert a single new object in the remote collection.

Link copied to clipboard
inline suspend fun MongoCollection<*>.updateOne(filter: BsonDocument, update: BsonDocument, upsert: Boolean = false): UpdateOneResult

Update or insert a single object in the remote collection.