parse-community / parse-community/parse-server

Extend index definition in Defined Schema

Open
#8,764 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

type:feature
Dominant language
JavaScript
Stars
21.4k
Forks
4.8k
Avg merge
7h 45m
Merged PRs (30d)
11

Description

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
    }
  }
}

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the Defined Schema index-definition entry point and its existing tests. Review how compound indexes are represented and compare the proposed backward-compatible array form with the alternative fields/options form. Done means the supported MongoDB index options can be expressed without breaking existing definitions and are covered by tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, mongodb
Domain
backend-api-design, databases
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.