Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
DarMi7 authored Nov 4, 2023
1 parent 2291ede commit b7ffc74
Showing 1 changed file with 15 additions and 11 deletions.
26 changes: 15 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,21 @@ a lambda-based object-oriented mongo query plug-in <br>
```
@Repository
public interface TaskRepository extends MongoRepository<Task, String> {
default Task one(TaskCriteria taskCriteria) {
return MongoLambdaQuery.lambdaQuery(Task.class)
.is(Task::getName, taskCriteria.getName())
.one();
}
default List<Task> list(TaskCriteria taskCriteria) {
return MongoLambdaQuery.lambdaQuery(Task.class)
.gt(Task::getCreated, taskCriteria.getBegin())
.lt(Task::getCreated, taskCriteria.getEnd())
.list();
}
default Page<Task> search(TaskCriteria taskCriteria) {
return MongoLambdaQuery.lambdaQuery(Task.class)
.is(Task::getName, taskCriteria.getName())
Expand All @@ -29,17 +44,6 @@ a lambda-based object-oriented mongo query plug-in <br>
.lt(Task::getCreated, taskCriteria.getEnd())
.page(taskCriteria.getPagination());
}
default Page<Task> aggregate(TaskCriteria taskCriteria) {
return MongoLambdaQuery.lambdaQuery(Task.class)
.is(Task::getName, taskCriteria.getName())
.is(Task::getType, taskCriteria.getFuzzyName())
.reg(Task::getName, taskCriteria.getName())
.gt(Task::getPoints, taskCriteria.getPoints())
.gt(Task::getCreated, taskCriteria.getBegin())
.lt(Task::getCreated, taskCriteria.getEnd())
.aggregate(taskCriteria.getPagination());
}
}
4. 具体使用案例参考demo模块,如有什么问题欢迎留言。<br>
原理分析可以查看博客:https://blog.csdn.net/qq_28175019/article/details/129100748
Expand Down

0 comments on commit b7ffc74

Please sign in to comment.