Php 使用mongodb实现curl查询
我尝试了很多事情,尝试并尝试从我的网站Appery中使用的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
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;