-
Notifications
You must be signed in to change notification settings - Fork 25
Open
Description
If I build a query with an index name but without any filter conditons, e.g.
new QueryBuilder()
.setTableName('Users')
.setHashKey('userId', ...)
.setIndexName('isAdmin-index')
.execute()FakeDynamo doesn't know which attribute that corresponds to
FakeTable.prototype.query = function(data) {
var indexedKeyName
if (data.IndexName) {
// Global Secondary Index if the index name has three or more
// parts (separated by '-')
var indexParts = data.IndexName.split('-')
var probableGSIIndex = indexParts.length >= 3
if (probableGSIIndex) {
return this._queryGlobalSecondaryIndex(data)
}
// Extract the range key for Local Secondary Indexes
for (var key in data.KeyConditions) {
if (key !== this.primaryKey.hash.name) {
indexedKeyName = key
}
}
}
...and (silently) fails to find anything as a result.
Metadata
Metadata
Assignees
Labels
No labels