[JAVA-1761] DocumentCodec cannot serialize embedded Set Created: 14/Apr/15 Updated: 05/May/15 Resolved: 20/Apr/15 |
|
| Status: | Closed |
| Project: | Java Driver |
| Component/s: | Codecs |
| Affects Version/s: | 3.0.0 |
| Fix Version/s: | 3.0.1, 3.1.0 |
| Type: | Improvement | Priority: | Minor - P4 |
| Reporter: | Jochen Kemnade | Assignee: | Jeffrey Yemin |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Description |
|
If an org.bson.Document contains a field whose value is a Set, serialization fails with
|
| Comments |
| Comment by Jeffrey Yemin [ 05/May/15 ] |
|
Closed for 3.0.1 release. |
| Comment by Githook User [ 20/Apr/15 ] |
|
Author: {u'username': u'jyemin', u'name': u'Jeff Yemin', u'email': u'jeff.yemin@10gen.com'}Message: When encoding a Document, encode all Iterable instances as BSON arrays, rather than just List instances. This is consistent with the behavior of the DBObject encoder, |
| Comment by Githook User [ 20/Apr/15 ] |
|
Author: {u'username': u'jyemin', u'name': u'Jeff Yemin', u'email': u'jeff.yemin@10gen.com'}Message: When encoding a Document, encode all Iterable instances as BSON arrays, rather than just List instances. This is consistent with the behavior of the DBObject encoder, |
| Comment by Jeffrey Yemin [ 14/Apr/15 ] |
|
Thanks Jochen, This is a reasonable request, though I'm going to remove the Regression label since Document is a new class. The DBObjectCodec does look for Iterable rather than List. |
| Comment by Jochen Kemnade [ 14/Apr/15 ] |
|
In 2.x, that worked via com.mongodb.util.JSON.serialize(Object) and com.mongodb.util.JSONSerializers.IterableSerializer.serialize(Object, StringBuilder). Probably, org.bson.codecs.DocumentCodec.writeValue(BsonWriter, EncoderContext, Object) should check for Iterable instread of List. |