Skip to content

Instantly share code, notes, and snippets.

@tudorels
Forked from neumino/gist:6554108
Created October 4, 2023 10:56
Show Gist options
  • Save tudorels/d0b1e79bc2dad5aa4782508d4e760af8 to your computer and use it in GitHub Desktop.
Save tudorels/d0b1e79bc2dad5aa4782508d4e760af8 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