The Wayback Machine - https://web.archive.org/web/20201215222324/https://github.com/MongoEngine/mongoengine/issues/1022
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sparse false when unique_with #1022

Open
kaiobrito opened this issue Jun 8, 2015 · 1 comment
Open

Sparse false when unique_with #1022

kaiobrito opened this issue Jun 8, 2015 · 1 comment

Comments

@kaiobrito
Copy link

@kaiobrito kaiobrito commented Jun 8, 2015

I'm trying to create a field like this:

unique_for_owner = fields.StringField(unique_with=["owner"], required=False, sparse=True).

But i notice that index was created with sparse=False.

I dropped my collection and made a few tests, so i notice that when unique_with has a value the sparse always getting False.

@MRigal
Copy link
Member

@MRigal MRigal commented Jun 14, 2015

Hi @kaiobrito
Thanks for reporting! I'm afraid we won't be able to fix that in mongoengine since it is a problem "wontfix" in MongoDB itself:
https://jira.mongodb.org/browse/SERVER-2193

But we may add a line to the documentation to prevent the users about that! Would you like to make a small documentation PR for that? Or do you have any other idea?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
3 participants
You can’t perform that action at this time.