i have one mongoDB collection which have follwing value
lat long band1
23.454 56.454 67
i want to updated that collection so that i get follwing collection
lat long band1 band2
23.454 56.454 67 73
csv which i want to use for update is contains
34.656,87.7565 ,78
size of this csv is 5gb
I'm using follwing commands to updated collection
mongoimport --db test --collection nct_test --upsert --upsertFields band2 --file gdalexportedb8.csv
but I'm getting follwing error..
Failed: error processing document #2: invalid character ',' looking for beginning of value
I want to know this is the right way or not and can anybody help me in this..
Regarding to your CSV file
Regarding to your command
--type csv--headerlinefor example:
$ cat > locations.csv
Name,Address,City,State,ZIP
Jane Doe,123 Main St,Whereverville,CA,90210
John Doe,555 Broadway Ave,New York,NY,10010
ctrl-d
$ mongoimport -d mydb -c things --type csv --file locations.csv --headerline
connected to: 127.0.0.1
imported 3 objects
$ mongo
MongoDB shell version: 1.7.3
connecting to: test
> use mydb
switched to db mydb
> db.things.find()
{ "_id" : ObjectId("4d32a36ed63d057130c08fca"), "Name" : "Jane Doe", "Address" : "123 Main St", "City" : "Whereverville", "State" : "CA", "ZIP" : 90210 }
{ "_id" : ObjectId("4d32a36ed63d057130c08fcb"), "Name" : "John Doe", "Address" : "555 Broadway Ave", "City" : "New York", "State" : "NY", "ZIP" : 10010 }