[CSHARP-1245] Add support for reading new formats defined in the latest version of MongoDB extended JSON Created: 20/Apr/15  Updated: 20/Jan/16  Resolved: 25/Jun/15

Status: Closed
Project: C# Driver
Component/s: BSON
Affects Version/s: 2.0
Fix Version/s: 2.1

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


 Description   

Add support for all formats defined in the latest version of the MongoDB extended JSON spec:

http://docs.mongodb.org/manual/reference/mongodb-extended-json/

For example, the following is not yet supported:

{ d : { $date : { $numberLong : "1234" } } }

Go through the spec and verify that all defined formats are supported. Add any missing unit tests.

This ticket is for reading only. There will be no change to the output formats for now.



 Comments   
Comment by Robert Stam [ 26/Jun/15 ]

The only missing new extended JSON format was:

{ d : { $date : { $numberLong : "1234" } } }

The JsonReader is also lenient in reading certain formats that are not strictly in the extended JSON spec but that are unambiguous:

{ b : { $binary : "base64", $type : INTEGER } }
{ d : { $date : { $numberLong : INTEGER } } }
{ n : { $numberLong : INTEGER } }

In all 3 cases according to the spec instead of INTEGER there should be a STRING, which will be parsed as an INTEGER, but the JsonReader also accepts an integer directly in these cases.

Comment by Githook User [ 25/Jun/15 ]

Author:

{u'username': u'rstam', u'name': u'rstam', u'email': u'robert@robertstam.org'}

Message: CSHARP-1245: Added support for reading new extended JSON formats.
Branch: master
https://github.com/mongodb/mongo-csharp-driver/commit/dcd4d326169e82997ac564f29c14c95abc471a3d

Generated at Wed Feb 07 21:39:03 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.