[JAVA-495] Support the BSON Symbol type Created: 21/Dec/11  Updated: 13/Mar/14  Resolved: 13/Mar/14

Status: Closed
Project: Java Driver
Component/s: BSON
Affects Version/s: None
Fix Version/s: None

Type: New Feature Priority: Major - P3
Reporter: Uladzimir Mihura Assignee: Unassigned
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related

 Description   

Mongo m = new Mongo();
DBCollection collection = m.getDB("test").getCollection("temp");
collection.insert(BasicDBObjectBuilder.start().add("char", 'c').get());

Resulting to:

Exception in thread "main" java.lang.IllegalArgumentException: can't serialize class java.lang.Character
     at org.bson.BasicBSONEncoder._putObjectField(BasicBSONEncoder.java:234)
     at org.bson.BasicBSONEncoder.putObject(BasicBSONEncoder.java:140)
     at org.bson.BasicBSONEncoder.putObject(BasicBSONEncoder.java:86)
     at com.mongodb.DefaultDBEncoder.writeObject(DefaultDBEncoder.java:27)
...



 Comments   
Comment by Jeffrey Yemin [ 13/Mar/14 ]

As stated, a character is not a symbol.

Comment by Jeffrey Yemin [ 24/Jan/14 ]

I'm not sure why a Character should be supported as a Symbol.

Comment by Uladzimir Mihura [ 21/Dec/11 ]

Similar to RUBY-117.

-vova

Generated at Thu Feb 08 08:52:25 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.