[MongoDB] ByteArray is stored as an Array instead of Binary since 4.9.4
svilen-todorov opened this issue · 4 comments
svilen-todorov commented
Expected Behavior
ByteArray to be stored as Binary data type in Mongo
Actual Behaviour
Since the 4.9.4 update ByteArray is stored as an array of Ints, which increases the used storage size a lot:
It could be related to this change: ae81d87#diff-57d1783e0cc7b290c77c65415c2f14d4f800bd3b108a3489b4879bd1864c811c
If this is intended as a feature, please suggest a way to get the old behavior back(store a Binary) when using the latest version.
Steps To Reproduce
- Create a Mongo Object in 4.9.4
- Store the object in Mongo
- Switch to 4.9.3
- Store the same object in Mongo
Environment Information
- Operating System: Windows
- JDK Version: Oracle OpenJDK 21.0.2
Example Application
No response
Version
4.6.3
dstepanov commented
Looks like a bug. You can try to annotate it with BsonRepresentation
svilen-todorov commented
Thank you, this solved the issue
sdelamo commented
@dstepanov @radovanradic I assume this is a regression and we will revert back to the previous behaviour.
radovanradic commented
Fixed in #3168