Skip to content

Instantly share code, notes, and snippets.

@johnnyeric
Forked from neumino/gist:6554108
Created April 11, 2016 00:23
Show Gist options
  • Select an option

  • Save johnnyeric/dd9984e4439b71393f48eb4ae292b842 to your computer and use it in GitHub Desktop.

Select an option

Save johnnyeric/dd9984e4439b71393f48eb4ae292b842 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"
}
]
}
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment