doulu1544 2010-03-09 17:49
浏览 125
已采纳

使用PHP为couchDB创建视图

I have started to try out noSQL databases now and are currently testing out couchDB. Seems like a good solution, but I really get some headache when I follow available examples on how to create views (queries) to select documents from a database and sort them.

Everything I can find is regarding JavaScript and it would be great to take part of some examples for PHP since that is the language we will use.

So, how do I create views using PHP for couchDB?

  • 写回答

4条回答 默认 最新

  • duangan6133 2010-03-09 17:52
    关注

    As far as I know, the equivalent of the SQL language that would be used for a relationnal database is, for CouchDB, Javascript.

    So, if you want to create some "query", or "view", you have to do it in that language : it's the one that's understood by CouchDb.


    PHP and CouchDb are totally independant : the only thing is that :

    • PHP can send requests to CouchDb
    • and get results

    But what happens on the CouchDb side is independant of your PHP script -- and there is no PHP on the CouchDb side.


    The only way to filter results using PHP would be to :

    • Request more data from CouchDb than you need
    • And throw away, from PHP, what's not needed

    But, obviously, that would not be an efficient solution...

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(3条)

报告相同问题?

悬赏问题

  • ¥15 乌班图ip地址配置及远程SSH
  • ¥15 怎么让点阵屏显示静态爱心,用keiluVision5写出让点阵屏显示静态爱心的代码,越快越好
  • ¥15 PSPICE制作一个加法器
  • ¥15 javaweb项目无法正常跳转
  • ¥15 VMBox虚拟机无法访问
  • ¥15 skd显示找不到头文件
  • ¥15 机器视觉中图片中长度与真实长度的关系
  • ¥15 fastreport table 怎么只让每页的最下面和最顶部有横线
  • ¥15 java 的protected权限 ,问题在注释里
  • ¥15 这个是哪里有问题啊?