How can i split 2 objects in a array Mongodb

i use mongoose.find() to list all of my data. I try to push the data in a array but all of my data is just in a array like:

const find = Info.find({}).then((data)=>  
{                                          
 posts.push(data);

 console.log(posts[0])
})

})

but the output is:

{ 

id: randomthing
,

name: randomthing,
                                                      
 }, 

{ 

id: randomthing2,

name:randomthing2, 

}

I want just the first object when I log posts[0] how can I split them?

Answer

data is an array. If you push it into posts and then read it again, it will always be an array.

Change posts.push(data); to posts.push(...data); to push the whole array into posts