如何解决我无法使用Mongotemplate在SpringBoot中编写聚合查询,并且其他我无法找到如何返回其结果?
@Override
public List<NodeData> AggregationQuery(String nodeId) {
Aggregation aggregation = newAggregation(Criteria.where("current").lt(35),group("nodeId").sum("current","voltage","OEE")
.as("totalCurrent","totalVoltage","totalOEE"));
AggregationResults<NodeData> groupResults = mongoTemplate.aggregate(aggregation,"nodeData",NodeData.class);
return groupResults;
}
错误
- 它显示return语句上的错误。
- 在组功能上,错误显示为:
The method group(String) is undefined for the type NodeDataRepositoryImpl
。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。