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
Explicitly disallow duplicate keys in data documents #1293
Explicitly disallow duplicate keys in data documents #1293
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #1293 +/- ##
==========================================
+ Coverage 67.31% 67.40% +0.09%
==========================================
Files 276 276
Lines 13024 13021 -3
==========================================
+ Hits 8767 8777 +10
+ Misses 3337 3325 -12
+ Partials 920 919 -1
Flags with carried forward coverage won't be shown. Click here to find out more. |
Deployment failed with the following error:
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for great refactor too 💪
@w84thesun, answering your questions about testing duplicates. Unfortunately, currently, such tests would fail because of #1263. I added a test with |
Description
Closes #364.
As agreed with the team, quite a big refactoring was made. Now
types.Document
's internal representation consists of a slice of fields where each field has astring
field andany
value.That approach allows having duplicated keys in documents in principle.
However,
Document.ValidateData
checks that there are no duplicates.Minor refactoring:
Document.Set
's signature doesn't returnerror
anymore, as, in fact, the implementation always returnsnil
. With that, there is no need to make the code more complicated (with all the checks for errors).Readiness checklist
task all
, and it passed.task godocs
.@FerretDB/core
), Assignee, Labels, Project and project's Sprint fields.