本文整理汇总了Java中com.mongodb.WriteResult.wasAcknowledged方法的典型用法代码示例。如果您正苦于以下问题:Java WriteResult.wasAcknowledged方法的具体用法?Java WriteResult.wasAcknowledged怎么用?Java WriteResult.wasAcknowledged使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.mongodb.WriteResult
的用法示例。
在下文中一共展示了WriteResult.wasAcknowledged方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: deleteUser
import com.mongodb.WriteResult; //导入方法依赖的package包/类
void deleteUser(MongoUser user) {
WriteResult result = delete(q().field(MongoTrack.USER).equal(key(user)));
if (result.wasAcknowledged()) {
log.debug("Removed user {} from {} measurement",
user, result.getN());
} else {
log.error("Error removing user {} from measurement: {}",
user, result);
}
}
示例2: removeTrack
import com.mongodb.WriteResult; //导入方法依赖的package包/类
void removeTrack(MongoTrack track) {
WriteResult delete = delete(q().field(MongoMeasurement.TRACK).equal(key(track)));
if (delete.wasAcknowledged()) {
log.debug("Removed track {} from {} measurements",
track, delete.getN());
} else {
log.error("Error removing track {} from measurements: {}",
track, delete);
}
}
示例3: deleteUser
import com.mongodb.WriteResult; //导入方法依赖的package包/类
void deleteUser(MongoUser user) {
WriteResult result = delete(q().field(MongoTrack.USER).equal(key(user)));
if (result.wasAcknowledged()) {
log.debug("Removed user {} from {} tracks",
user, result.getN());
} else {
log.error("Error removing user {} from tracks: {}",
user, result);
}
}
示例4: deleteUser
import com.mongodb.WriteResult; //导入方法依赖的package包/类
@Override
public boolean deleteUser(String userId) {
WriteResult result = deleteByQuery(createQuery().field("userName").equal(userId));
return result.wasAcknowledged();
}
示例5: deleteAllUsers
import com.mongodb.WriteResult; //导入方法依赖的package包/类
@Override
public boolean deleteAllUsers() {
WriteResult result = deleteByQuery(createQuery());
return result.wasAcknowledged();
}
示例6: deleteAllBlogs
import com.mongodb.WriteResult; //导入方法依赖的package包/类
@Override
public boolean deleteAllBlogs() {
WriteResult result = deleteByQuery(createQuery());
return result.wasAcknowledged();
}
示例7: deleteBlogById
import com.mongodb.WriteResult; //导入方法依赖的package包/类
@Override
public boolean deleteBlogById(String id) {
WriteResult result = deleteByQuery(createQuery().field("_id").equal(id));
return result.wasAcknowledged();
}