List of usage examples for com.mongodb WriteResult wasAcknowledged
public boolean wasAcknowledged()
From source file:com.r573.enfili.common.resource.db.mongo.MorphiaDbManager.java
License:Apache License
public <T extends BaseMongoObject> void findAndDelete(Class<T> clazz, String queryField, String queryValue) { log.debug("findAndDelete for type " + clazz.getName() + " queryField " + queryField + " searchTerm " + queryValue);/*from w ww. j a va 2 s . c om*/ Query<T> query = ds.find(clazz, queryField, queryValue); WriteResult result = ds.delete(query); if (!result.wasAcknowledged()) { throw new MongoRuntimeException(ERR_DB_WRITE_FAILURE, "Error, write was not acknowleged for delete query: " + query.toString()); } }