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

[docs] Unique fields #384

Closed
natew opened this issue Dec 1, 2017 · 3 comments
Closed

[docs] Unique fields #384

natew opened this issue Dec 1, 2017 · 3 comments

Comments

@natew
Copy link
Contributor

natew commented Dec 1, 2017

Notice there is uniqueItems documented, and that primary fields are assumed to be unique, but didn't see anything for just unique fields.

It does seem like it may work by searching code, but perhaps some tests + docs would help. I'm going to test to see if it works now as-is, and then could help with some docs.

@natew
Copy link
Contributor Author

natew commented Dec 1, 2017

Ok did some verification, and it seems unique wasn't enforced for me. I changed the schema to have unique: true, it warned me it changed, cleared data, inserted a few things with the same property and it worked.

@pubkey
Copy link
Owner

pubkey commented Dec 4, 2017

We currently do not have unique fields.
uniqueItems is part of json-schema, but only works for elements of arrays.

@natew
Copy link
Contributor Author

natew commented Dec 5, 2017

All good, doing a find on preInsert is good enough.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants