[JAVA-2447] Implement Extended JSON specification Created: 13/Feb/17 Updated: 28/Apr/19 Resolved: 21/Jul/17 |
|
| Status: | Closed |
| Project: | Java Driver |
| Component/s: | JSON |
| Affects Version/s: | None |
| Fix Version/s: | 3.5.0 |
| Type: | New Feature | Priority: | Major - P3 |
| Reporter: | Jeffrey Yemin | Assignee: | Jeffrey Yemin |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||||||||||||||||||||||||||||||||||
| Description |
|
Specification: https://github.com/mongodb/specifications/blob/master/source/extended-json.rst |
| Comments |
| Comment by Sivakeshavulu vadlamudi [ 28/Apr/19 ] |
|
HI Jeff Yemin
com.mongodb.util.JSON.serialize is working properly is there any other alternate solution? // or use a connection string// or use a connection string MongoClientURI connectionString = new MongoClientURI("mongodb://localhost:27017"); MongoClient mongoClient = new MongoClient(connectionString);
output (JSON) = { "_id" : { "$oid" : "5cc2e1d4734a1f4d66966554"}, "name" : "mkyong-updated" , "age" : 30 , "createdDate" : { "$date" : "2019-04-26T10:47:48.643Z"}}
|
| Comment by sivakeshavulu [ 26/Apr/19 ] |
|
Dear Jeff Yemin can you please give me one java example for more understanding.
|
| Comment by Jeffrey Yemin [ 26/Apr/19 ] |
|
See our extended JSON specification at https://github.com/mongodb/specifications/blob/master/source/extended-json.rst#id10. You may be looking for "Relaxed" extended JSON format, which is not the default but can be requested via the Document.toJson(JsonWriterSettings) overloaded method |
| Comment by sivakeshavulu [ 26/Apr/19 ] |
|
Dear Jeff Yemin Date format is wrong my MongoDb and java Driver rutting the date is not same please refer below. "createdDate" : ISODate("2019-04-26T10:47:48.643+0000") - MongodB collection data "createdDate": {"$date": 1556275668643}} - Java Driver Reponse
Please help us Expecting same as mongodb: i am facing issue on date ( Java Code
// or use a connection string// or use a connection string MongoClientURI connectionString = new MongoClientURI("mongodb://localhost:27017"); MongoClient mongoClient = new MongoClient(connectionString);
Reponse :{"_id": {"$oid": "5cc2e1d4734a1f4d66966554"}, "name": "mkyong-updated", "age": 30, "createdDate": {"$date": 1556275668643}}
MongoDB : { "_id" : ObjectId("5cc2e1d4734a1f4d66966554"), "name" : "mkyong-updated", "age" : NumberInt(30), "createdDate" : ISODate("2019-04-26T10:47:48.643+0000") }
|
| Comment by Githook User [ 21/Jul/17 ] |
|
Author: {u'username': u'jyemin', u'name': u'Jeff Yemin', u'email': u'jeff.yemin@10gen.com'}Message: Support new canonical and relaxed extended JSON forms Change extended JSON parser to throw exceptions for documents |
| Comment by Githook User [ 22/Mar/17 ] |
|
Author: {u'username': u'jyemin', u'name': u'Jeff Yemin', u'email': u'jeff.yemin@10gen.com'}Message: |
| Comment by Githook User [ 22/Mar/17 ] |
|
Author: {u'username': u'jyemin', u'name': u'Jeff Yemin', u'email': u'jeff.yemin@10gen.com'}Message: |
| Comment by Githook User [ 16/Mar/17 ] |
|
Author: {u'username': u'jyemin', u'name': u'Jeff Yemin', u'email': u'jeff.yemin@10gen.com'}Message: |
| Comment by Githook User [ 15/Mar/17 ] |
|
Author: {u'username': u'jyemin', u'name': u'Jeff Yemin', u'email': u'jeff.yemin@10gen.com'}Message: |