Skip to content

Instantly share code, notes, and snippets.

@neumino
Created July 5, 2014 19:39
Show Gist options
  • Save neumino/7d369404a9178f7fed15 to your computer and use it in GitHub Desktop.
Save neumino/7d369404a9178f7fed15 to your computer and use it in GitHub Desktop.
// Index:
r.table("heroes").indexCreate("idEquipment", function(doc) {
return doc("equipment").map(function(equipment) {
return [doc("id"), equipment]
})
}, {multi: true}).run(conn, callback)
// Query
r.table("heroes").getAll([1, "boots"], {index: "idEquipment"}).run(conn, callback)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment