Skip to content

Support secondary indices in findAll #7

Open
@jmdobry

Description

@jmdobry

Example:

adapter.findAll(User, {
  where: {
    age: { '>': 30 },
    status: 'unknown'
  }
});

Let's say there is a secondary index setup on the "status" field. In order to tell the query to take advantage of this, I propose the following:

adapter.findAll(User, {
  where: {
    age: { '>': 30 },
    status: { '==': 'unknown' }
  }
}, {
  keys: ['status']
});

Which will optimize the query by first doing a getAll('unknown', { index: 'status' }) and then adding the filter calls.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions