Does CouchDB support multiple range queries?

前端 未结 4 780
太阳男子
太阳男子 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:22

    You're using arrays as your keys. Couchdb will compare arrays by comparing each array element in increasing order until two element are not equal.

    E.g. to compare [1,'a',5] and [1,'c',0] it will compare 1 whith 1, then 'a' with 'c' and will decide that [1,'a',5] is less than [1,'a',0]

    This explains why your range key query fails:

    ["7446567e45dc5155353736cb3d6041c0",nil,5,30000] is greater ["7446567e45dc5155353736cb3d6041c0",nil,5,90000]

提交回复
热议问题