Skip to content

Extend index definition in Defined Schema #8764

Open
@mtrezza

Description

@mtrezza

New Feature / Enhancement Checklist

Current Limitation

In Defined Schema, only simple compound indexes can be defined, the following index options cannot be defined:

Feature / Enhancement Description

Add support for the above mentioned index options. These options do not have to be added explicitly, instead a general field ofr index options should be added to the index definition.

Example Use Case

To avoid a breaking change, index options could be added by using an array instead of an object:

indexes: {
  index_without_option: {
    location: "2dsphere"
  },
  index_with_option: [{
    location: "2dsphere"
  }, {
    sparse: true
  }]
}

Alternatively for type consistency with breaking change:

indexes: {
  index_without_option: {
    fields: {
      location: "2dsphere"
    }
  },
  index_with_option: {
    fields: {
      location: "2dsphere"
    },
    options: {
      sparse: true
    }
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bounty:$100Bounty applies for fixing this issue (Parse Bounty Program)type:featureNew feature or improvement of existing feature

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions