简体   繁体   English

Php mongo 客户端计数查询不起作用 Mongo 4 版本

[英]Php mongo client count query not working Mongo 4 version

I have upgrade MongoDB version 4 from 3. the below query is not working in the php mongo client.我已经从 3 升级了 MongoDB 版本 4。下面的查询在 php mongo 客户端中不起作用。

db.transaction_history.count(array("transaction_type" => "post_create", 'nid' => 111111),array('nid' => 1))

the above query was working in the older version上面的查询在旧版本中工作

please help me to fix this issue.请帮我解决这个问题。

Here is an example with the new php mongo driver v 1.5+ (supporting MongoDB v4)这是新的 php mongo 驱动程序 v 1.5+(支持 MongoDB v4)的示例


$mongoClient->myCollection->count($search, $options);

https://www.php.net/manual/en/mongocollection.count.php https://www.php.net/manual/en/mongocollection.count.php

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM