-
-
Save johnnyeric/dd9984e4439b71393f48eb4ae292b842 to your computer and use it in GitHub Desktop.
Filtering nested arrays with RethinkDB
This file contains hidden or 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("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