当前位置: 首页>>代码示例>>Java>>正文


Java WriteResult.wasAcknowledged方法代码示例

本文整理汇总了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);
    }
}
 
开发者ID:enviroCar,项目名称:enviroCar-server,代码行数:11,代码来源:MongoMeasurementDao.java

示例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);
    }
}
 
开发者ID:enviroCar,项目名称:enviroCar-server,代码行数:11,代码来源:MongoMeasurementDao.java

示例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);
    }
}
 
开发者ID:enviroCar,项目名称:enviroCar-server,代码行数:12,代码来源:MongoTrackDao.java

示例4: deleteUser

import com.mongodb.WriteResult; //导入方法依赖的package包/类
@Override
public boolean deleteUser(String userId) {
	WriteResult result = deleteByQuery(createQuery().field("userName").equal(userId));
	return result.wasAcknowledged();
}
 
开发者ID:srihas,项目名称:vertx-spring-mongo-blog,代码行数:6,代码来源:UserDAOImpl.java

示例5: deleteAllUsers

import com.mongodb.WriteResult; //导入方法依赖的package包/类
@Override
public boolean deleteAllUsers() {
	WriteResult result = deleteByQuery(createQuery());
	return result.wasAcknowledged();
}
 
开发者ID:srihas,项目名称:vertx-spring-mongo-blog,代码行数:6,代码来源:UserDAOImpl.java

示例6: deleteAllBlogs

import com.mongodb.WriteResult; //导入方法依赖的package包/类
@Override
public boolean deleteAllBlogs() {
	WriteResult result = deleteByQuery(createQuery());
	return result.wasAcknowledged();
}
 
开发者ID:srihas,项目名称:vertx-spring-mongo-blog,代码行数:6,代码来源:BlogDAOImpl.java

示例7: deleteBlogById

import com.mongodb.WriteResult; //导入方法依赖的package包/类
@Override
public boolean deleteBlogById(String id) {
	WriteResult result = deleteByQuery(createQuery().field("_id").equal(id));
	return result.wasAcknowledged();
}
 
开发者ID:srihas,项目名称:vertx-spring-mongo-blog,代码行数:6,代码来源:BlogDAOImpl.java


注:本文中的com.mongodb.WriteResult.wasAcknowledged方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。