Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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!

like image 632
Matthew Yang Avatar asked Aug 29 '26 05:08

Matthew Yang


1 Answers

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.

like image 166
XplosiVe06 Avatar answered Sep 01 '26 16:09

XplosiVe06



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!