You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When create a IndexType.value for a string field, and query using lessOrEqual and lessThan with the value larger than then last record, eg \uffff, the query return zero record instead of all record
@Entity()
classDoc {
int? id;
@Index(type:IndexType.value)
String key;
Doc({
requiredthis.key,
});
}
box.put(Doc(key:'b'));
box.put(Doc(key:'c'));
box.put(Doc(key:'d'));
// this line is correntexpect(box.query(Doc_.key.lessOrEqual('d')).build().find(), hasLength(3));
// expected result to be 3 but return 0expect(box.query(Doc_.key.lessOrEqual('e')).build().find(), hasLength(3));
The text was updated successfully, but these errors were encountered:
I think less and greater is only properly defined for integers, not sure if this is even supposed to work with strings. It's supposed to work as explicitly added for strings.
Anyhow, I guess a query should return the same results regardless if an index is used or not.
When create a
IndexType.value
for a string field, and query usinglessOrEqual
andlessThan
with the value larger than then last record, eg\uffff
, the query return zero record instead of all recordreproduce repo: https://github.com/lokingwei/objectbox_string_lessthan
The text was updated successfully, but these errors were encountered: