Details
-
Improvement
-
Resolution: Done
-
Minor - P4
-
None
-
2.6.1
-
None
-
Fully Compatible
Description
Whereas JSON.parse can parse the "scalar" types as well, and as such can return not just BSONObject, but also String or Long, BSON.encode/decode only work with BSONObject.
https://jira.mongodb.org/browse/JAVA-298
I'd like to be able to also do for example
byte[] aLong = BSON.encode(1l);
byte[] aString = BSON.encode("string");
For encode, this could be added as a new overload, for decode it would need to change the return type (from BSONObject to Object), so for the sake of compatibility, one would need to add a new method name.