I have an arbitrary MongoDB JSON find query string, for example:
{ "address.city": "Seattle"}
or
{ qty: { $gt: 5, $lt: 50 }
Is there any existing method to create a Doctrine.MongoDB.Query object from the JSON string? Or alternately to query mongo directly and then pass those results to doctrine for hydration?
Is there any existing method to create a Doctrine.MongoDB.Query object from the JSON string?
At this moment no, however we could add setQuery
method to the Builder
. More tedious, but working, would be instantiating Query
class on your own.
Or alternately to query mongo directly and then pass those results to doctrine for hydration?
Once you have plain arrays with data (and you're not afraid to dive into UnitOfWork
) you may utilize $dm->getUnitOfWork()->getOrCreateDocument() or employ HydratorFactory
and merge documents into DocumentManager
later.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With