Created
July 31, 2014 18:41
-
-
Save thelinuxlich/677c710270cf41a55d78 to your computer and use it in GitHub Desktop.
query hell
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
// Getting all sessions by secondary index on client_id field, but excluding one client_id, so I return every client id from the clients table but the one not desired | |
r.db("aidax").table("sessions").getAll( | |
r.args( | |
r.db("aidax").table("clients") | |
.filter( | |
function(client) { | |
return client("id").ne("0f338aa9-0d16-4e00-8301-f5ddabf313de") | |
} | |
).map(function(client) { | |
return client("id") | |
}).coerceTo('array')) | |
,{index: "client_id"} | |
) |
AtnNn
commented
Jul 31, 2014
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment