public static ODocument update(String collectionName,String rid, JsonNode bodyJson) throws InvalidCollectionException,InvalidModelException, ODatabaseException, IllegalArgumentException, DocumentNotFoundException, UpdateOldVersionException {
ODocument doc=get(collectionName,rid);
if (doc==null) throw new InvalidParameterException(rid + " is not a valid document");
//update the document
DocumentDao dao = DocumentDao.getInstance(collectionName);
dao.update(doc,(ODocument) (new ODocument()).fromJSON(bodyJson.toString()));
return doc;//.toJSON("fetchPlan:*:0 _audit:1,rid");
}//update