Does CouchDB support multiple range queries?

前端 未结 4 682
太阳男子
太阳男子 2020-12-19 13:48

How are multiple range queries implemented in CouchDB? For a single range condition, startkey and endkey combination works fine, but the same thing is not working with a mu

4条回答
  •  时光说笑
    2020-12-19 14:26

    Actually CouchDB allows views to have complex keys which are arrays of values as given in the question:

    [template_id, loan_name, loan_period, loan_amount]
    

    Have you tried

    params = {:startkey =>["7446567e45dc5155353736cb3d6041c0",nil,5,30000],
      :endkey=>["7446567e45dc5155353736cb3d6041c0",{}],:include_docs => true}
    

    or perhaps

    params = {:startkey =>["7446567e45dc5155353736cb3d6041c0","\u0000",5,30000],
      :endkey=>["7446567e45dc5155353736cb3d6041c0","\u9999",{}],:include_docs => true}
    

提交回复
热议问题