1

How it is possible to create a QUERY using GREATER option with strings? I see that this is possible only for numeric or data properties. I have data coming from an IBM legacy database where dates are saved in timestamp fornat "YYYY-MM-DD HH:MM:SS". So, to test if a date is less or greater of a given date I have to compare two strings.

1
  • Please show an example of the data that you want to query and the expected results. What have you tried so far? Commented Apr 15, 2018 at 9:21

2 Answers 2

0

We missed that one. I just opened a ticket for this so you can track this feature. We'll try to support this shortly.

PS.: For your use case, you could have a long timestamp or Date property additionally.

Sign up to request clarification or add additional context in comments.

Comments

0

With the new versions of Objectbox this is now possible.

Example with Dates:

// you should define the lowest possible date as string
String lowestDate = LocalDate.now().minusMonths(3).toString();

getMyAlbumBox().query().greater(ObjectToQuery_.date, lowestDate).build()

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.