Skip to content

Instantly share code, notes, and snippets.

@aj07mm
Created March 25, 2015 18:07
Show Gist options
  • Save aj07mm/30087bcbdc0bb7b44e1a to your computer and use it in GitHub Desktop.
Save aj07mm/30087bcbdc0bb7b44e1a to your computer and use it in GitHub Desktop.
filter rethinkdb
filtered = list(r.table(collection).filter(
lambda doc: \
(doc['id'] == _filters.get('id')).default(False) | \
(doc['userIds'].contains(_filters.get('userIds'))).default(False) | \
(doc['checkpointIds'].contains(_filters.get('checkpointIds'))).default(False)
).run(self.rdb_conn))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment