Open serkandurusoy opened 9 years ago
Thanks I will fix it in the next release
While at it, could you also enhance the index
definition so that we can create unique
indexes?
You already can create unique
indexes by passing options. Read the documentation for Mongo Indexes. However I know that it should be something that is more easily accessible, so I will add unique
option to definition of the field.
Oh, I was not aware that the unique
option could be passed in the indexes.options
object. Thanks!
According to https://github.com/jagi/meteor-astronomy-validators/blob/master/lib/validators/comparison/unique.js#L11
you are checking for uniqueness only during inserts. But updates should also apply the validation rule.
Consider a case where I want usernames to be unique.
I insert
user1
anduser2
and then decide that I want to updateuser2
and want to set it touser1
which bypasses the unique check, hence misleading.