I just got started using mongoDB with php. I've gotten everything up and running, but here is my first "This can't be right" moment:
When I was working with MySQL, my goto debug move was:
- echo $query so I can see what php is sending to the MySQL server.
- paste that query into the MySQL shell to start figuring out why it's not working right.
Now with mongoDB, that's not as straight forward. The syntax for the mongoDB shell and the syntax for the MongoDB PHP Driver are different.
So how are we supposed to debug our queries? Best I found sofar is that Studio 3T has a feature called Query Code, which gives me the mongoDB shell command and the corresponding php code for any query that is built using their GUI tools.
Ideally I'd want something where I can paste either my PHP code or my shell command, and get the corresponding syntax of the other one.
Can anyone recommend tools which accomplish this 'syntax translation'?