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

Minor Data Layer Fixes Oct 2020 #2648

Merged
merged 1 commit into from
Oct 26, 2020

Conversation

ErikDakoda
Copy link
Contributor

  • Updated JSDoc comments for Mongo.Collection.prototype.addField() and fixed a minor bug.
  • Updated validateModifier() to include documentId in the context of custom field validators. Validators can use it to make sure that a value is unique in the collection. Without the documentId, the validator can't tell if an existing document with a unique value is being updated or if a new document with a conflicting value is attempted to be inserted.
  • Updated default resolvers to include the collection name when throwing a missing_document error.

 * Updated JSDoc comments for `Mongo.Collection.prototype.addField()` and fixed a minor bug.
 * Updated `validateModifier()` to include `documentId` in the context of custom field validators. Validators can use it to make sure that a value is unique in the collection. Without the `documentId`, the validator can't tell if an existing document with a unique value is being updated or if a new document with a conflicting value is attempted to be inserted.
 * Updated default resolvers to include the collection name when throwing a `missing_document` error.
@ErikDakoda ErikDakoda requested a review from eric-burel October 24, 2020 14:03
@eric-burel eric-burel merged commit 45fcad6 into VulcanJS:devel Oct 26, 2020
@ErikDakoda ErikDakoda deleted the MinorDataLayerFixesOct2020 branch December 22, 2020 13:51
@ErikDakoda
Copy link
Contributor Author

Hi @SachaG! I noticed that you have reverted my change to collection.addField() in this commit.

I wonder if you meant to do that. I am not sure if you have seen my explanation for that change (please see above). Could we discuss this further? As I mentioned it looks to me that the usage of collection.options.schema is an outlier, as everywhere else in the code collection.simpleSchema()._schema is used, for example in removeField().

@EloyID
Copy link
Contributor

EloyID commented Apr 9, 2021

Hi I have the same issue due to this modification be86cc7#diff-6bef4e846751805d4e7f0e4bc392cc8125125fdaae89046b5e0fc06233eb8e38
I think it's the same as ErikDakoda has mentionned. Is there any reason to do this modification?

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

Successfully merging this pull request may close these issues.

4 participants