Created
August 27, 2014 19:45
-
-
Save thelinuxlich/0e08270bdfa2062fe435 to your computer and use it in GitHub Desktop.
query with between
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
r.table("errors").between( | |
["Uncaught Error: Error calling method on NPObject.", "1", r.now().sub(24 * 60 * 60)], ["Uncaught Error: Error calling method on NPObject.", "1", r.now()], { | |
index: "message_id_created_at" | |
} | |
) |
Another question: How did you create the message_id_created_at
index exactly? Does it work as expected in other queries?
Here's an example that works for me.
I suspect something might be wrong with the index or the data types in your case, but that's just a guess.
r.tableCreate('t1')
r.table('t1').insert({message: "foo", client_id: "1", created_at: r.now()})
r.table('t1').indexCreate("message_id_created_at", function(x) {
return [x("message"), x("client_id"), x("created_at")]; } )
r.table('t1').between(["foo", "1", r.now().sub(24*60*60)], ["foo", "1", r.now()], {index:"message_id_created_at"})
I created the index like this:
r.table('t1').indexCreate("message_id_created_at", [r.row("properties")("message"), r.row("client_id"), r.row("created_at")]);
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What happens if you run this? Do you get an error or does it just not return any results?
I don't see anything obviously wrong with the query. Theoretically this should work.