clarkie / dynogels

DynamoDB data mapper for node.js. Originally forked from https://github.com/ryanfitz/vogels

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

What is the syntax for getItems with a composite primary key?

aneilbaboo opened this issue · comments

The documentation only shows an example like Model.getItems(["hashkey1", "hashkey2"], .... The AWS documentation indicates that for a table with a composite primary key you must pass both the hash and rangeKey.

Does Dynogels accept an array of arrays like this?

Model.getItems([['hk1', 'rangeKey1' ], ['hk2', 'rangeKey2'], ...], ...)

I don't recall if that is supported, but I know that an array of objects is supported:

Model.getItems([
  { hashKey: 'value1', rangeKey: 'value2' },
  { hashKey: 'value3', rangeKey: 'value4' },
  ...
])

(Where hashKey and rangeKey are the actual attribute names for your hash key and range key.)