Hi! I’ve created a function in realm that needs to be run before the login or even the registration. That means that app.currentUser is null. The problem is that I don’t find in the documentation how to do that.
I found this:
const result = await user.functions.sum(numA, numB);
const resultOfCallFunction = await user.callFunction("sum", myArgs); // alternate syntax to call a MongoDB Realm Function
console.log(
`Using the "functions.sum()" method: the sum of ${numA} + ${numB} = ${result}`
);
console.log(
`Using the "callFunction()" method: the sum of ${numA} + ${numB} = ${resultOfCallFunction}`
);
This works fine with authenticated users but how do I get system functions? The documentation keep talking about using the “system user”:
But I cannot find anywhere how I can use that user in my app. I just need to call that function.