MongoEngine / MongoEngine/mongoengine
Doubt: How to specify collation on Documents(Collection)?
Open
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 4.3k
- Forks
- 1.2k
- Avg merge
- 4h 41m
- Merged PRs (30d)
- 11
Description
I have the following class:
class Subject(me.Document):
name = me.StringField(unique=True)
topic = me.StringField(required=True, choices=('Language', 'Other'))
isCompulsory = me.BooleanField(required=True, default=False)
meta = {
'collation': {
'locale': 'en',
'caseLevel': False
}
}
The Docs do not provide any example.
I have two problems:
- How can I make
choicesto be case-insensitive. - I am able to insert values like
physics,Physicsinnamefield. How to make DB treat them as same?
NB: I have dropped Collection (using MongoDB Compass) before trying this.
Info:
- MongoDB Version :
4.0.3
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
The issue names no repository file, test, or entry point; start by locating the documentation for Document/Collection collation and StringField choices, then verify the MongoDB 4.0.3 behavior described. Done means the documentation explains case-insensitive choices and duplicate handling for name, with an example covering the stated meta configuration.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- mongodb, python
- Domain
- database, documentation
- Issue type
- Documentation
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100