I want to convert a CSV line into a GeoJSON object. I am using CSVReader. Hence, nextLine[] has all the separated tokens. I want to create BasicDBObject which has various attributes stored. I am doing it following way.
new BasicDBObject("attribute1",nextLine[0]).append("attribute2",nextLine[1])
What I want to achieve is having a document like this in MongoDB
{
attribute1: name
attribute2: address
location:{ type : "Point" ,
coordinates : [lat, long]
}
attrribute3: phonenumber
}
How do I do this using BasicDBObject?enter code here