Get data from mongo cluster to realm function

I am trying to get data from collection to realm function but getting only object object

     const cluster ="mongodb-atlas");
   const users = cluster.db("ssn").collection("invites");
   const stories = cluster.db("ssn").collection("stories");
   const twilio ="Twilio");
   const story = await stories.find({});

Hi @Jayesh_Sharma,

You are missing the toArray() and the parsing:

Try this:

exports = function(arg){
    const collection ="mongodb-atlas").db("test").collection("test");
    collection.find({}).toArray().then((docs) => {


1 Like

hii @MaBeuLux88 , it displays only first data not all.

My function above prints all the documents in the test.test collection.

Make sure you are not using findOne() instead of find() or something like that. Also the query might be filtering more than you think?

@MaBeuLux88 , I am using the same you have told me.