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 dminkovsky/463f862c395588c50755 to your computer and use it in GitHub Desktop.
Save dminkovsky/463f862c395588c50755 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