Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save terrancesnyder/a77638e343fadb4e8240a45fe37e6107 to your computer and use it in GitHub Desktop.
Save terrancesnyder/a77638e343fadb4e8240a45fe37e6107 to your computer and use it in GitHub Desktop.
rethinkdb_merge_pushdown_crazy.js
r.db('test')
.table('templates')
.filter({ network: { id: 'USA-0034' } })
.concatMap(function(d) {
return d('layers').do(function(l) {
return l.merge({ template: d('id') })
});
})
.filter({ image_var: 'product_shot_url' })
.map(function(d) {
return {
template: d('template'),
left: d('object')('left'),
top: d('object')('top'),
oX: d('object')('originX'),
oy: d('object')('originY')
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment