-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Incorrect result when querying against date field #19
Comments
Go's However, the query expects the already converted value (see Therefore, the usage in the failing test should look like this instead: func TestGreaterThanDate(t *testing.T) {
storedTime, err := objectbox.TimeInt64ConvertToDatabaseValue(t2)
if err != nil {
t.Error(err)
}
q := personBox.Query(
person.Person_.Time.GreaterThan(storedTime),
person.Person_.Time.OrderAsc(),
)
people, _ := q.Find()
if people[0].Time.Unix() != t1.Unix() {
t.Errorf("Expected t1 (%d) but got %d\nt0: %d, t1: %d, t2: %d", t1.Unix(), people[0].Time.Unix(), t0.Unix(), t1.Unix(), t2.Unix())
}
} With Thanks for pointing this out. We will update the docs to mention this and also create an internal issue to track whether there can be something helpful done using code generation. |
Updated docs: https://golang.objectbox.io/custom-types#queries |
Thanks for the clarification. |
Please see attached sample project with failing test case.
testObjectBox.zip
The text was updated successfully, but these errors were encountered: