Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
JObjectField doesn't serialize to BSON #1346
JObjectField isn't fully working following issue 1314 being fixed. In the current builds, JObjectField will serialize to something like "JObject(List(JField(minutes,Jint(59))))", rather than the intended BSON data structure.
The issue is that -fieldDbValue in BsonRecord falls through to the o.toString option when it asDBObject tried to create the DBObject.
I was able to shim in something that uses the mongo driver's JSON parser to deserialize a serialized JObject into a DBObject in the case that fieldDbValue gets a JObject, but it feels kinda hacky.
The current "get set from JValue" test only covers the fact that the JObject can in-fact be set on a given record, but it doesn't cover a round trip to BSON and back.