-
Type: Task
-
Resolution: Fixed
-
Priority: Minor - P4
-
Affects Version/s: None
-
Component/s: None
-
None
-
Not Needed
-
Summary
When you insert a document into an encrypted collection, the safeContent field is automatically added. (This field is necessary for QE to work.) If you attempt to then find that document and let the driver automatically deserialize it to a POCO you've defined, the driver throws an exception:
Unhandled exception. System.FormatException: Element 'safeContent' does not match any field or property of class <your POCO class>.
I was able to avoid this error by adding theĀ
[BsonIgnoreExtraElements] attribute to my POCO class, but it would be nice if the driver were aware that it should ignore that field.
Motivation
Who is the affected end user?
Anyone using the C# driver for QE with POCOs
How does this affect the end user?
Throws an exception if the attribute is not added
How likely is it that this problem or use case will occur?
Assuming most users use POCOs, this is a main path error
If the problem does occur, what are the consequences and how severe are they?
The app doesn't work without the attribute
Is this ticket required by a downstream team?
No
Is this ticket only for tests?
No
Acceptance Criteria
Ideally, I wouldn't need to add this attribute to the class in order for QE to work with POCOs. If that's not possible, we can discuss documenting this requirement somewhere.