parse-community / parse-community/parse-server
Extend index definition in Defined Schema
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 21.4k
- Forks
- 4.8k
- Avg merge
- 7h 45m
- Merged PRs (30d)
- 11
Description
New Feature / Enhancement Checklist
- I am not disclosing a vulnerability.
- I am not just asking a question.
- I have searched through existing issues.
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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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