ReQL is smart enough to parse strings and sort them. If you have the date in the correct format, it should still filter with .lt in the string.
r.db("database").table("table") .filter( r.row('upload_date') .lt( new Date( new Date() - (24*60*60*1000) ).toISOString().replace(/\..{4}/, '').replace(/T/, ' ') ) )
-
Greetings
- EDIT -
(Use Regex101.com to study or test)
The requested regular expression in the String.replace() method:
FIRST - (Dump the end of the time code)
for example: "2017-03-20T17: 17: 37.966Z" → "2017-03-20T17: 17: 37"
- Find the first literal period.
\. - → And after 4 characters
.{4}
Replace the above group with an empty quote or nothing
SECOND -
for example: "2017-03-20T17: 17:37" → "2017-03-20 17:17:37"
- Find the first instance of the character
T
Replace the group above with a run or ""
This establishes that the string should be able to compare inside rethink db
NOTIFICATION. RethinkDB as a project has been dropped, but will be opened. If you need support, consider other resources for your projects.
Relic source share