[CSHARP-195] the 'System.Char' type save as 'Number' Created: 07/Apr/11  Updated: 02/Apr/15  Resolved: 07/Apr/11

Status: Closed
Project: C# Driver
Component/s: None
Affects Version/s: 1.0
Fix Version/s: 1.0

Type: Bug Priority: Major - P3
Reporter: ymind chan Assignee: Robert Stam
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

the 'System.Char' type save as 'Number', but Want it to be 'String'



 Comments   
Comment by Robert Stam [ 07/Apr/11 ]

Int32 is the default type for Char because it is the most compact. You can override the default and choose to serialize it as a string like this:

public class C

{ public ObjectId Id; [BsonRepresentation(BsonType.String)] public char X; }
Generated at Wed Feb 07 21:36:05 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.