0
Hello, I’m importing a collection of documents from mongodb, I’m importing from a csv file, I’m having trouble importing key pairs:value, mongodb is recognizing everything as string, example: I want the document to be saved like this on import.
"coordinates" : {
"latitude" : -9.646375,
"longitude" : -35.728146
},
But you’re being saved like this:
"coordinates" : "{\"latitude\" :-9.739.990.639.836.790, \"longitude\" : -3.664.870.887.994.760}"
}
The csv file has the coordinates field like this
coordinates
{"latitude" :-9.262.132.106.882.630, "longitude" : -3.793.454.647.064.200}
I would like help so that I can import the document and the database recognizes this dictionary as it really is, not as a string.
I appreciate all your help!
I don’t get it. Do you have the file, read it somewhere? With some language? How are you importing in Mongo?
– Aline
It is in the shell of Mongo, there is a file that I import your data into the Mongo database. One of these data is composed(coordinates{lat,long}) and I don’t know how to import this data in accordance with the database.
– Carlos Andre