Cloudant NoSql:如何在php中运行查询以获得指定的json文档


Cloudant NoSql : how to run a query in a php to get a specified json document?

我正在使用一个php文件连接到我的Cloudant数据库并检索一个特定的Json文档。连接正常,但我如何在php文件中运行此查询以返回结果?我已经在Cloudant Dashbord上测试了查询,我可以可视化的结果

{
  "selector": {
    "datetime": {
      "$gt": 0
    }
  },
  "fields": [
    "_id",
    "_rev",
    "status",
    "datetime",
    "temperature",
    "humidity",
    "sunintesity"
  ],
  "sort": [
    {
      "datetime": "desc"
    }
  ],
  "limit" : 1
}

我建议您看看Cloudant Docs-Libraries and Tutorials#PHP。在那里,您可以找到一些其他语言的CRUD示例,以及一些指向您可以在应用程序中使用的有用库或框架的指针。