MongoDB Realm: TypeError: user.mongoClient is not a function

484 views Asked by At

When I'm calling:

const user = await app.logIn(creds);
const mongodb = user.mongoClient("mongodb-atlas");

from react-native in an attempt to connect to MongoDB Atlas (app is an instance of a Realm App) I'm getting the following error:

TypeError: user.mongoClient is not a function

The user is not null and I can call user.logOut successfully. I'm not sure where to from here. Any ideas?

Thanks in advance!

1

There are 1 answers

0
XplosiVe06 On

A bit late but for those coming here with the same problem, see my stackoverflow question here and the opened issue in realm-js github.

user.callFunction() and user.mongoClient() are unavailable while debugging using Chrome.

They are not going to fix this because they are working on Hermes engine and Flipper debugging instead.