#While creating a secondary index on Model, how can I define what attributes to copy over to the GSI?

3 messages · Page 1 of 1 (latest)

static acorn
#

Right now I cannot see any parameters to define it.

exotic dagger
#

const schema = a.schema({
Customer: a
.model({
name: a.string(),
phoneNumber: a.phone(),
accountRepresentativeId: a.id().required(),
})
.secondaryIndexes((index) => [
index("accountRepresentativeId")
.name("MyCustomIndexName"),
])
.authorization(allow => [allow.owner()]),
});