realm-kotlin icon indicating copy to clipboard operation
realm-kotlin copied to clipboard

MongoDB Functions

Open sync-by-unito[bot] opened this issue 3 years ago • 2 comments

Similar to Realm Java we should expose MongoDB Functions in the API: https://docs.mongodb.com/realm-sdks/java/latest/io/realm/mongodb/functions/Functions.html

interface io.realm.mongodb.functions.Functions {
  val user: User
  val app: App
  val defaultCodecRegistry: CodecRegistry

  suspend fun <ResultT> callFunction(name: String, args: List<Any>, resultDecoder: Decoder<ResultT>)
 suspend fun callFunction(name: String, args: List<Any>, resultClass: KClass<ResultT>)
 suspend fun callFunction(name: String, args: List<Any>, codecRegistry: CodecRegistry)
}

// Access Functions through the user
val user = app.login(credentials)
val functions = user.functions

sync-by-unito[bot] avatar Sep 02 '21 14:09 sync-by-unito[bot]

Any idea about when functions will be added to the Kotlin SDK?

jeanbaptistebeau avatar Mar 29 '22 08:03 jeanbaptistebeau

Unfortunately not. It is on our near term roadmap but depends on #648 being done first.

cmelchior avatar Mar 29 '22 08:03 cmelchior

And now that's it's done? 😁

jeanbaptistebeau avatar Dec 08 '22 15:12 jeanbaptistebeau

@jeanbaptistebeau We have a PR with support here: https://github.com/realm/realm-kotlin/pull/1110. It is going through a final review now.

cmelchior avatar Dec 08 '22 15:12 cmelchior