Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/264.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 使用mongodb实现curl查询_Php_Mongodb_Curl - Fatal编程技术网

Php 使用mongodb实现curl查询

Php 使用mongodb实现curl查询,php,mongodb,curl,Php,Mongodb,Curl,我尝试了很多事情,尝试并尝试从我的网站Appery中使用的CURL中的Mongo DB返回值 我得到一个返回的结果,但是,我只需要STP字段。从我读过的代码下面应该给我这个,但它不是。我还希望结果仅在AuditorName字段为非空时出现。不过我得到了完整的记录集 如有任何建议,将不胜感激 $region = "EGOLI"; $ch = curl_init(); $qry_str = urlencode('{"Region": "'.$region.'"}'); $ecount = urlen

我尝试了很多事情,尝试并尝试从我的网站Appery中使用的
CURL
中的
Mongo DB
返回值

我得到一个返回的结果,但是,我只需要
STP
字段。从我读过的代码下面应该给我这个,但它不是。我还希望结果仅在AuditorName字段为
非空时出现。不过我得到了完整的记录集

如有任何建议,将不胜感激

$region = "EGOLI";
$ch = curl_init();
$qry_str = urlencode('{"Region": "'.$region.'"}');
$ecount = urlencode('{"AuditorName":{$ne:null}},{ STP:1, Region: 0, SalesDistrict: 0, OutletName: 0, LicenceNo: 0, OwnerName: 0, OwnerCell: 0, TVPhotoBack: 0, TVPhotoFront: 0, TVPhotoWorking:0, OwnerDocPhoto:0, OutletFront:0, OutletFacia :0, Comments:0, approved:0, sabcomments:0}');
curl_setopt($ch, CURLOPT_URL, 'https://api.appery.io/rest/1/db/collections/Reach?where='.$qry_str.'&'.$ecount.'&limit=1000');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('X-Appery-Database-Id: 57xxxxxxxxxxxxxxxxxxxx83','Content-type: application/json'));
$result = curl_exec($ch);
echo $result;
$outletlist = $result;