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)=>  



but the output is:


id: randomthing

name: randomthing,


id: randomthing2,



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


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(; to push the whole array into posts