Skip to content

Instantly share code, notes, and snippets.

@dalanmiller
Created July 19, 2016 18:25
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dalanmiller/84400513be90c30d0b53d45a8ec0b87a to your computer and use it in GitHub Desktop.
Save dalanmiller/84400513be90c30d0b53d45a8ec0b87a to your computer and use it in GitHub Desktop.
// Creating an index that returns true or false based on if certain property is > 0
r.db("example").table("example").indexCreate("example_index", (row) => { return row('above_zero').gt(0) })
// Only returns true values
r.db("example").table("example").getAll( true , {index: "above_zero"})
// Only returns false values
r.db("example").table("example").getAll( false , {index: "above_zero"})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment