1. In MongoShell, create a collection with an array field that contains a timestamp field.
> db.arrayCollection.insert( { "_id":"123", "a":[ {"id":"one", "d":ISODate("2015-10-06T12:00:00Z")}, {"id":"two", "d":ISODate("2015-10-06T12:01:00Z")} ] } )
2. Check the field length. Since there are two entries in the array field, it should return 2.
> db.arrayCollection.findOne({"_id":"123"}).a.length
2
3. Bring up the Table Data Editor for the collection and update the array field, e.g. change "one" to "One". Check the Preview SQL tab and note that the generated UPDATE statement is as follows. The value of "a" is enclosed in single quotes, making it a string value.
5. In MongoShell, check the field length again.
> db.arrayCollection.findOne({"_id":"123"}).a.length
124
6. Check the schema browser or run a SHOW FIELDS command for arrayCollection. Field "a" has become a "string" field.
2 KB
236 KB
292 KB
131 KB
11 KB
From Emil:
According to MongoDB Extended JSON documentation, there are two JSON modes: the "strict mode" and the "mongo shell mode". The com.mongodb.util.JSON.parse() method supports the strict mode only. This parse method does not recognize function calls, hence an exception is thrown when function calls (e.g. ISODate() ) are present.
- Updated MongoDB JDBC Driver to provide a utility method to use the current MongoSQL parser (which supports the mongo shell mode) to validate JSON objects and arrays, thus function calls are allowed.
- Updated Table Data Editor to use the utility method to validate JSON objects and arrays.
- Updated MongoDB JDBC Driver to provide a utility method to use the current MongoSQL parser (which supports the mongo shell mode) to validate JSON objects and arrays, thus function calls are allowed.
- Updated Table Data Editor to use the utility method to validate JSON objects and arrays.
Verified in ADS v15.0.16-2. QA will go through v15 build and follow the new patch process. Raghav to review.
Verified in ADS v15.0.16-2. QA will go through v15 build and follow the new patch process. Raghav to review.
Verified in ADS 15.0.16-2, ADS 16.0.9-2 and ADS 17.0.0-rc-14. Please refer screenshots.
Verified in ADS 15.0.16-2, ADS 16.0.9-2 and ADS 17.0.0-rc-14. Please refer screenshots.
Please refer attached Detail_steps_and_Scenarios.docx also.
Please refer attached Detail_steps_and_Scenarios.docx also.
Issue #13770 |
Closed |
Fixed |
Resolved |
Completion |
No due date |
Fixed Build ADS 15.0.16-2, ADS 16.0.9-2 |
No time estimate |
From Emil:
According to MongoDB Extended JSON documentation, there are two JSON modes: the "strict mode" and the "mongo shell mode". The com.mongodb.util.JSON.parse() method supports the strict mode only. This parse method does not recognize function calls, hence an exception is thrown when function calls (e.g. ISODate() ) are present.