Docs Menu

Docs HomeDevelop ApplicationsAtlas Device SDKs

Class Functions

On this page

  • io.realm.mongodb.functions
  • Method Summary
  • Inherited Methods
  • Method Detail
  • callFunction
  • callFunctionAsync
  • getApp
  • getDefaultCodecRegistry
  • getUser
  • invoke
io.realm.mongodb.functions.Functions

A Functions manager to call remote Realm functions for the associated Realm App.Arguments and results are encoded/decoded with the Functions' codec registry either inherited from the AppConfiguration.getDefaultCodecRegistry() or set explicitly when creating the

Functions-instance through User.getFunctions(CodecRegistry) or through the individual calls to callFunction(String, List, Class, CodecRegistry) .

Tip

See also:

Modifier and Type
Method and Description
public ResultT
callFunction <ResultT >(
String name,
<any> resultDecoder
)

Call a MongoDB Realm function synchronously with custom result decoder.

public ResultT

Call a MongoDB Realm function synchronously with default codec registry encoding/decoding arguments/results.

public ResultT
callFunction <ResultT >(
String name,
CodecRegistry codecRegistry
)

Call a MongoDB Realm function synchronously with custom codec registry encoding/decoding arguments/results.

String name,
<any> resultDecoder,
)

Call a MongoDB Realm function asynchronously with custom result decoder.

Call a MongoDB Realm function asynchronously with custom codec registry for encoding/decoding arguments/results.

String name,
java.lang.Class<T> resultClass,
CodecRegistry codecRegistry,
)

Call a MongoDB Realm function asynchronously with custom codec registry for encoding/decoding arguments/results.

public App

Returns the App that this instance in associated with.

public CodecRegistry

Returns the default codec registry used for encoding arguments and decoding results for this Realm functions instance.

public User

Returns the User that this instance in associated with.

protected abstract T
invoke <T >(
String name,
CodecRegistry codecRegistry,
<any> resultDecoder
)
  • Methods inherited from class java.lang.Object : getClass , hashCode , equals , clone , toString , notify , notifyAll , wait , wait , wait , finalize

public ResultT callFunction <ResultT >(
String name,
<any> resultDecoder
)

Call a MongoDB Realm function synchronously with custom result decoder.The arguments will be encoded with the default codec registry encoding.

Type Parameters

  • ResultT - The type that the response will be decoded as using the resultDecoder

Parameters

  • name - Name of the Realm function to call.

  • args - Arguments to the Realm function.

  • resultDecoder - The decoder used to decode the result.

Returns

Result of the Realm function.

Throws

public ResultT callFunction <ResultT >(
)

Call a MongoDB Realm function synchronously with default codec registry encoding/decoding arguments/results.

Type Parameters

  • ResultT - The type that the response will be decoded as using the default codec registry.

Parameters

  • name - Name of the Realm function to call.

  • args - Arguments to the Realm function.

  • resultClass - The type that the functions result should be converted to.

Returns

Result of the Realm function.

Throws

public ResultT callFunction <ResultT >(
String name,
CodecRegistry codecRegistry
)

Call a MongoDB Realm function synchronously with custom codec registry encoding/decoding arguments/results.

Type Parameters

  • ResultT - The type that the response will be decoded as using the codecRegistry .

Parameters

  • name - Name of the Realm function to call.

  • args - Arguments to the Realm function.

  • resultClass - The type that the functions result should be converted to.

  • codecRegistry - Codec registry to use for argument encoding and result decoding.

Returns

Result of the Realm function.

Throws

Call a MongoDB Realm function asynchronously with custom result decoder.This is the asynchronous equivalent of callFunction(String, List, Decoder).

Type Parameters

  • T - The type that the response will be decoded as using the resultDecoder

Parameters

  • name - Name of the Realm function to call.

  • args - Arguments to the Realm function.

  • resultDecoder - The decoder used to decode the result.

  • callback - The callback that will receive the result or any errors from the request.

Returns

The task representing the ongoing operation.

Throws

Call a MongoDB Realm function asynchronously with custom codec registry for encoding/decoding arguments/results.This is the asynchronous equivalent of callFunction(String, List, Class) .

Type Parameters

  • T - The type that the response will be decoded as using the default codec registry.

Parameters

  • name - Name of the Realm function to call.

  • args - Arguments to the Realm function.

  • resultClass - The type that the functions result should be converted to.

  • callback - The callback that will receive the result or any errors from the request.

Returns

The task representing the ongoing operation.

Throws

String name,
java.lang.Class<T> resultClass,
CodecRegistry codecRegistry,
)

Call a MongoDB Realm function asynchronously with custom codec registry for encoding/decoding arguments/results.This is the asynchronous equivalent of callFunction(String, List, Class, CodecRegistry) .

Type Parameters

  • T - The type that the response will be decoded as using the default codec registry.

Parameters

  • name - Name of the Realm function to call.

  • args - Arguments to the Realm function.

  • resultClass - The type that the functions result should be converted to.

  • codecRegistry - Codec registry to use for argument encoding and result decoding.

  • callback - The callback that will receive the result or any errors from the request.

Returns

The task representing the ongoing operation.

Throws

public App getApp ()

Returns the App that this instance in associated with.

Returns

The App that this instance in associated with.

public CodecRegistry getDefaultCodecRegistry ()

Returns the default codec registry used for encoding arguments and decoding results for this Realm functions instance.

Returns

The default codec registry.

public User getUser ()

Returns the User that this instance in associated with.

Returns

The User that this instance in associated with.

protected abstract T invoke <T >(
String name,
CodecRegistry codecRegistry,
<any> resultDecoder
)
← io.realm.mongodb.functions