Reputation: 157
Below is the quick start code to initiate the app given in MongoDB realm docs.
import Realm from 'realm';
let app;
// Returns the shared instance of the Realm app.
export function getRealmApp() {
if (app === undefined) {
const appId = 'demo'; // Set Realm app ID here.
const appConfig = {
id: appId,
timeout: 10000,
app: {
name: 'demo',
version: '0',
},
};
app = new Realm.App(appConfig);
}
return app;
}
when I call that function, I always get:
empty object {}
Version of realm : "^10.0.0-beta.12"
Upvotes: 1
Views: 377
Reputation: 444
Here's my answer from another SO post. I believe the issue is on their side, not on your side; it's not possible to print objects directly. This isn't limited to the app
object.
The developers have suggested using .toJSON()
as a workaround. See this post from the MongoDB Developer forum.
I've had some troubles converting any Realm objects to printable strings; I always get {} just like you do. I think it could be related to this (unresolved) task on their GitHub.
On a similar note, there are some bugs in Realm's authentication system. I'm trying to get email/password, Facebook, and Google authentication going in my application but all of them currently seem to be broken on Realm's side.
Here are some related issues on their GitHub that you can follow for a solution.
Facebook Google Email/pass (fixed, but not released in the latest beta)
I don't have any information about JWT specifically but given these other authentication issues there's a good chance the issue isn't on your side. I recommend opening an Issue on their repository.
Upvotes: 3