Closed cardoso-neto closed 1 year ago
- Updates on any attribute in
Document.hashing_fields
should raise an error.- There should be test coverage of this behavior.
What is the relation between this and the title?
Currently the default _id of a document is an object id, which is essentially random.
I'd like users to be able to use the result of get_hash as the _id by default.
This would have to be done on an override of the .dict()
method (similar to what you had done before for the the hash
attr, but for the _id
attr).
However, if a user updates one of the hashable_fields
while using get_hash()
for _ids, the _id will no longer match the contents of the document, therefore users should be prevented from shooting themselves in the foot in this manner.
Fixed on the last refactoring
Document.hashing_fields
should raise an error.