1

Is there any way to dump the query from a Doctrine Mongodb ODM query builder. Something like $builder->getQuery()->toString() is what I am looking for. Any alternative would be useful. And also a way to dump parameters.

I need to see in a particularly complex build process, where certain $builder->addOr() statements are getting nested.

Bluebox
  • 373
  • 2
  • 12

1 Answers1

1

Found the answer! Missed this the first time I inspected the ODM vendor package.

$builder->getQuery()->debug();

https://github.com/doctrine/mongodb-odm/blob/ecb96f90e8c282a42b1f103cb3011ade9f97876f/lib/Doctrine/ODM/MongoDB/Query/Query.php#L160

Bluebox
  • 373
  • 2
  • 12