Commit 5a8c60af authored by pengxin's avatar pengxin

删除文档集合接口优化处理。

parent 04ba9957
......@@ -22,12 +22,12 @@ public interface DatasetDataService {
void save(DatasetData datasetData);
/**
* 删除该数据集
* 删除整个集合中的文档数据
*
* @param versionId 版本标识。
* @return 返回受影响的行数。
*/
Long delete(Long versionId);
void delete(Long versionId);
/**
* 根据id查询该条信息。
......
......@@ -116,14 +116,12 @@ public class DatasetDataServiceImpl implements DatasetDataService {
}
/**
* 删除该数据集
* 删除整个集合中的文档数据
*
* @param versionId 版本标识。
* @return 返回受影响的行数。
*/
public Long delete(Long versionId) {
Query query = new Query(Criteria.where(MongoConstant.VERSION).is(versionId));
return mongoTemplate.remove(query, DatasetData.class,
MongoConstant.COLLECT_NAME + versionId).getDeletedCount();
public void delete(Long versionId) {
mongoTemplate.dropCollection(MongoConstant.COLLECT_NAME + versionId);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment