Is there any solution for this problem?
Assume I've db as;
{
name: "Alex"
id: 1
}
{
name: "Felix"
id: 2
}
db.collection.find({}, {name:1, id:0}).toArray()
returns as;
result
object
name: Alex
object
name: Felix
I've already limit the fields to get only name as an array. Is there any way to do this? Why this query returns in [object OBJECT] format?
My solution is; traversing result and insert each name object into some array. I'm looking something different than this. Maybe it's about the query I wrote?