try {
DBCollection collection = this.connection.getDB().getCollection(collectionName);
DBObject object = buildDBObject(record);
DBObject translation = buildDBObject(translationRecord);
if (operation == MongoOperation.UPDATE) {
WriteResult result = collection.update(translation, object, mongoSpec.isUpsert(), mongoSpec.isMulti());
return result.getN() > 0;
} else {
throw new ResourceException("Invalid operation: " + operation);
}
} catch (Exception exception) {
ResourceException resourceException = new ResourceException(exception.toString());