ObjectNode node = (ObjectNode)Json.mapper().readTree(json);
node.remove(TO_REMOVE);
node.remove("@rid");
return node;
} catch (RidNotFoundException e) {
throw new CommandExecutionException(command,"document: "+id+" does not exists");
} catch (UpdateOldVersionException e) {
throw new CommandExecutionException(command,"document: "+id+" has a more recent version");
} catch (DocumentNotFoundException e) {
throw new CommandExecutionException(command,"document: "+id+" does not exists");
} catch (InvalidCollectionException e) {
throw new CommandExecutionException(command,"invalid collection: "+coll);
} catch (InvalidModelException e) {
throw new CommandExecutionException(command,"error updating document: "+id+" message: "+e.getMessage());
} catch (JsonProcessingException e) {
throw new CommandExecutionException(command,"data do not represents a valid document, message: "+e.getMessage());
} catch (IOException e) {
throw new CommandExecutionException(command,"error updating document: "+id+" message:"+e.getMessage());
}
}