Skip to content

Instantly share code, notes, and snippets.

@neumino
Created December 2, 2013 02:11
Show Gist options
  • Save neumino/7743879 to your computer and use it in GitHub Desktop.
Save neumino/7743879 to your computer and use it in GitHub Desktop.
codingkevin - IRC - 2013/12/01
r.table("authors").filter( function(author) {
return author("posts").contains( function(post) {
post("tags").contains("tagSearched")
})
}).map( function(author) {
author.merge({
posts: author("posts").filter( function(post) {
post("tags").contains("tagSearched")
})
})
})
@neumino
Copy link
Author

neumino commented Dec 2, 2013

r.db('test').table('test').get('ce054cba-48f3-424f-8884-e7332ee0e77d').do(function(author) {
    return author.merge({
        posts: author("posts").filter( function(post) {
             return post("tags").contains("tagSearched")
        })
    })
})

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