How can I make mongodb return results in a simple array?
Ex:
My first query:
$user_ids = $dm->createQueryBuilder('AcmeBundle:Users')
->hydrate(false)
->select('_id')
->getQuery()
->execute();
My second query:
$no_credit = $dm->getRepository('AcmeBundle:Places')
->createQueryBuilder('places')
->distinct('_id')
->field('visited.users')
->in($user_ids)
->getQuery()
->count();
How can I achieve this when the first query won't return an array of MongoID objects?
MongoCursoras such getting the cursor object and doingiteratortoarrayor something similar will solve the problem in a hackish way.field('wtvr')->in(array(,,,)).in(). It is the only way due to how Mongo returns the results.