0
我注意到RethinkDB中的函數中的複合索引奇怪的東西。它似乎檢索與查詢不匹配的結果。下面詳細介紹。RethinkDB複合索引奇怪使用之間使用
r.dbCreate('test')
r.db('test').tableCreate('numbers')
r.db('test').table('numbers').insert([
{ first: 1, second: 1 },
{ first: 1, second: 2 },
{ first: 1, second: 3 },
{ first: 1, second: 4 },
{ first: 1, second: 5 },
{ first: 2, second: 1 },
{ first: 2, second: 2 },
{ first: 2, second: 3 },
{ first: 2, second: 4 },
{ first: 2, second: 5 },
{ first: 3, second: 1 },
{ first: 3, second: 2 },
{ first: 3, second: 3 },
{ first: 3, second: 4 },
{ first: 3, second: 5 },
{ first: 4, second: 1 },
{ first: 4, second: 2 },
{ first: 4, second: 3 },
{ first: 4, second: 4 },
{ first: 4, second: 5 },
{ first: 5, second: 1 },
{ first: 5, second: 2 },
{ first: 5, second: 3 },
{ first: 5, second: 4 },
{ first: 5, second: 5 }
])
r.db('test').table('numbers').indexCreate(
"both", [r.row("first"), r.row("second")])
r.db('test').table('numbers').orderBy({index :'both'}).between(
[2, 3], [3, 5], {index: 'both', rightBound: 'closed'}).without('id')
// output
{ "first": 3 ,
"second": 3
} // ok
{ "first": 3 ,
"second": 4
} // ok
{ "first": 2 ,
"second": 5
} // ok
{ "first": 3 ,
"second": 1
} // not ok
{ "first": 3 ,
"second": 5
} // ok
{ "first": 3 ,
"second": 2
} // not ok
{ "first": 2 ,
"second": 3
} // ok
{ "first": 2 ,
"second": 4
} // ok
查詢中的數組看起來不像AND或OR。我錯過了什麼或者這是一個錯誤?