I get tweets and use org.json.simple api to convert a string to an object.
JSONParser jsonParser = new JSONParser();
Object json = jsonParser.parse(in);
and I would like to insert obj in couchdb using couchdb4j api
Session myDbSession = new Session("localhost",5984)
Database myCouchDb = myDbSession.getDatabase("db-name");
Document newdoc = new Document();
Document newdoc = new Document(JSONObject json);
myCouchDb.saveDocument(newdoc);
Error:
org.json.simple.JSONObject cannot be cast to net.sf.json.JSONObject
how to solve this problem, or can someone give a solution to insert a string or json format object in couchdb
source
share