Noticed on ADS 14-beta-23.
Attached are the 2 files students.csv and studentsnew.csv
Steps to reproduce issue:
1) students.csv is the original data and in it, we could observe _id values are retained properly e.g. mix of integer and ObjectId data such as 5000, "5189d4ecaf450dadcddd09be" and so on.
2) Now we import this file into a newly created collection named 'studentsnew' using 'Tools->Import Data' (default settings)
3) We re-export data from studentsnew collection using 'Tools->Export Data' (default settings) and studentsnew.csv is the output file generated.
Expected behavior:
a) Contents of students.csv and studentsnew.csv should match.
Actual behavior:
a) If we compare these both files (using compare files or other diff utilities), we note that integers in _id fields are converted to strings like "5000" etc.
Could you please investigate whats causing this? Thanks
|
|
65 KB
|
|
65 KB
|
|
139 KB
Could be an effect of modifications made in this issue.
You didn't attach a screenshot of what you specified in the Format tab of the Import dialog when you imported the csv file. My guess is that you specified "string" as the data type for the _id field and therefore all _id values were imported as string data.
Since the _id values have different data types, if you want to keep the original data type, you will need to separate the data based on the data type -- integer values in one file and ObjectId in another file. Then when importing each file, specify the appropriate data type for the _id field.
You didn't attach a screenshot of what you specified in the Format tab of the Import dialog when you imported the csv file. My guess is that you specified "string" as the data type for the _id field and therefore all _id values were imported as string data.
Since the _id values have different data types, if you want to keep the original data type, you will need to separate the data based on the data type -- integer values in one file and ObjectId in another file. Then when importing each file, specify the appropriate data type for the _id field.
Jenny, pls find attached the screenshot for import settings.
The alternative you have suggested should be working but would be cumbersome in real scenario. In the situations like these lack of export/import format in JSON will be dearly missed. :(
Jenny, pls find attached the screenshot for import settings.
The alternative you have suggested should be working but would be cumbersome in real scenario. In the situations like these lack of export/import format in JSON will be dearly missed. :(
Issue #9367 |
| Closed |
| Invalid |
| Resolved |
Completion |
| No due date |
| No fixed build |
| No time estimate |
2 issue links |
relates to #8820
Issue #8820inconsistent behavior of import data feature of ADS |
depends upon #8740
Issue #8740Import/Export enhancement for MongoDB |
Could be an effect of modifications made in this issue.