Skip to content

Instantly share code, notes, and snippets.

@neumino
Created September 13, 2013 18:11
Show Gist options
  • Save neumino/6554108 to your computer and use it in GitHub Desktop.
Save neumino/6554108 to your computer and use it in GitHub Desktop.
Filtering nested arrays with RethinkDB
r.table("test").filter( function(doc) {
return doc("adresses").contains(function(adress) {
return adress("city").eq("Paris")
})
})
/*
{
name: "Bob",
adresses: [
{
country: "France",
city: "Paris"
}
]
}
*/
@HeikoMueller
Copy link

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment