douxi8759 2019-06-10 12:22
浏览 32

将mongo shell查询转换为php的建议

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:

  1. echo $query so I can see what php is sending to the MySQL server.
  2. 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'?

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 有赏,i卡绘世画不出
    • ¥15 如何用stata画出文献中常见的安慰剂检验图
    • ¥15 c语言链表结构体数据插入
    • ¥40 使用MATLAB解答线性代数问题
    • ¥15 COCOS的问题COCOS的问题
    • ¥15 FPGA-SRIO初始化失败
    • ¥15 MapReduce实现倒排索引失败
    • ¥15 ZABBIX6.0L连接数据库报错,如何解决?(操作系统-centos)
    • ¥15 找一位技术过硬的游戏pj程序员
    • ¥15 matlab生成电测深三层曲线模型代码