I have this Collection
{
"_id" : ObjectId("55555555ffffff000010200a"),
"name" : "foo"
}
{
"_id" : ObjectId("55555555ffffff000010200e"),
"name" : "bar"
}
{
"_id" : ObjectId("55555555ffffff000010200f"),
"name" : "baz"
}
{
"_id" : ObjectId("55555555ffffff000010200b"),
"name" : "biz"
}
and I want an array ids
I did this
db.mycollection.find({}, {_id: 1})
and return
{
"_id" : ObjectId("55555555ffffff000010200a")
}
{
"_id" : ObjectId("55555555ffffff000010200e")
}
{
"_id" : ObjectId("55555555ffffff000010200f")
}
{
"_id" : ObjectId("55555555ffffff000010200b")
}
{
"_id" : ObjectId("55555555ffffff000010200c")
}
{
"_id" : ObjectId("55555555ffffff0000103111")
}
Can I have an array? id['55555555ffffff0000103111','55555555ffffff0000103111','555555555ffffff0000103111','55555555ffffff0000103111']