Doctrine ODM(mongoDB) query command

557 Views Asked by At

I've a problem with executing Doctrine command:

php bin/console doctrine:mongodb:query "db.store.find({})"

and the result is:

Not enough arguments (missing: "query").

can anyone explain what is the correct way of providing a query to the command? In the documentation I can't find any examples.

1

There are 1 best solutions below

0
ArturoO On

Ok, I've managed to make it work.

For anyone interested, the correct format is:

php bin/console doctrine:mongodb:query App\\Document\\Store\\Store '{"name": "Store A"}'

where the first part is the name of a class, and the second one is a text query that can be decoded to a JSON.