Tomas Re
Tomas Re

Reputation: 369

Global Secondary Index Object Property

Is there a way to create a global secondary index and project a field from an object?
For example if my documents are in the format:

{
  id: 12345,
  account: {
    user: 'john doe'
  },
  ...
}

If I create a global secondary index is there a way to use account.user as the key?
Is there a way to have account.user as a projected attribute even if its not the key?

Upvotes: 2

Views: 569

Answers (1)

Alexander Patrikalakis
Alexander Patrikalakis

Reputation: 5205

You cannot key an index on nested document properties. They need to be top-level attributes. See this post for more details.

Upvotes: 3

Related Questions