during
ReQL command: during
Command syntax
time.during(start_time, end_time[, :left_bound => "closed", :right_bound => "open"]) → bool
Description
Return whether a time is between two other times.
By default, this is inclusive of the start time and exclusive of the end time. Set left_bound
and right_bound
to explicitly include (closed
) or exclude (open
) that endpoint of the range.
Example: Retrieve all the posts that were posted between December 1st, 2013 (inclusive) and December 10th, 2013 (exclusive).
r.table("posts").filter{ |post| post['date'].during(r.time(2013, 12, 1, "Z"), r.time(2013, 12, 10, "Z")) }.run(conn)
Example: Retrieve all the posts that were posted between December 1st, 2013 (exclusive) and December 10th, 2013 (inclusive).
r.table("posts").filter{ |post| post['date'].during(r.time(2013, 12, 1, "Z"), r.time(2013, 12, 10, "Z"), :left_bound => "open", :right_bound => "closed") }.run(conn)
Related commands
Get more help
Couldn't find what you were looking for?
- Ask a question on Stack Overflow
- Chat with us and our community on Slack
- Talk to the team on IRC on #rethinkdb@freenode.net — via Webchat
- Ping @rethinkdb on Twitter
- Post an issue on the documentation issue tracker on GitHub
© RethinkDB contributors
Licensed under the Creative Commons Attribution-ShareAlike 3.0 Unported License.
https://rethinkdb.com/api/ruby/during/