MongoDB return a non enumerable objects


I have a react native app.
realm object returned from MongoDB return my documents where all the properties are non-enumerable.
How can I retrieve them as enumerable? I can’t use spread operator on them

Thank you

Hi @Aviation_W_B,

I did a project with the alpha version of this NPM project (that is managed by @Andrew_Meyer in MongoDB). The lib has evolved a bit now, but maybe this can help?


@Aviation_W_B The spread operator is not yet implemented on Realm.Objects, but we are currently working on support for this. In the meantime, you can use toJSON() on the object to transform it into a JavaScript object.
If you run into any issues, can you please provide code samples of what you are trying so that we can understand what you are trying to achieve?

1 Like