So, the problem is to get ids (or any another fields) in one array, like:
[
"someId1",
"someId2",
"someId3",
]
I tried to take it by next query:
$this->createQueryBuilder()
->select('_id')
->hydrate(false)
->getQuery()
->toArray()
but I took not what I want, but near this:
112 => array:1 [
"_id" => 112
]
113 => array:1 [
"_id" => 113
]
114 => array:1 [
"_id" => 114
]
(I use strategy INCREMENT). I tried do this by map, reduce, but I understood that I know nothing in these functions :). So can somebody help me?
P.S: I know how to realise this with php functions, like array_keys | array_values
. But I really want to know how to do it by mongoDB, and particularly, in ODM with createQueryBuilder