Skip to content

Instantly share code, notes, and snippets.

@brfrn169
Created January 25, 2023 01:25
Show Gist options
  • Save brfrn169/ee516b3d5b0de6fdbd72f0cb87b97fe3 to your computer and use it in GitHub Desktop.
Save brfrn169/ee516b3d5b0de6fdbd72f0cb87b97fe3 to your computer and use it in GitHub Desktop.
Example of Get/Scan with index
// Get query with a secondary index on the “country” column of the “back” table
query BankGetWithIndex {
get_with_index: bank_getWithIndexOn_country(get: {indexKey : {country:"france"}}){
bank {id, region_code, country}
}
}
// Scan query with a secondary index on the “region_code” column of the “bank” table
query BankScanWithIndex {
scan_with_index: bank_scanWithIndexOn_region_code(scan: {indexKey: {region_code: 1}}) {
bank {id region_code country}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment