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条)

报告相同问题?

悬赏问题

  • ¥20 双层网络上信息-疾病传播
  • ¥50 paddlepaddle pinn
  • ¥20 idea运行测试代码报错问题
  • ¥15 网络监控:网络故障告警通知
  • ¥15 django项目运行报编码错误
  • ¥15 请问这个是什么意思?
  • ¥15 STM32驱动继电器
  • ¥15 Windows server update services
  • ¥15 关于#c语言#的问题:我现在在做一个墨水屏设计,2.9英寸的小屏怎么换4.2英寸大屏
  • ¥15 模糊pid与pid仿真结果几乎一样