使用mongo db进行卷曲查询

时间:2016-09-22 06:43:09

标签: php mongodb curl

我正在尝试一些事情,尝试并尝试使用Mongo DB从我网站上的Appery中使用的CURL返回值。

我收到了返回的结果,但是,我只想要STP字段。从我读过的代码下面应该给我这个,但不是。我还希望结果仅在AuditorName字段为NOT NULL的位置。我虽然得到了完整的记录集。

非常感谢任何建议。

$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;

0 个答案:

没有答案
相关问题