spring-projects / spring-projects/spring-data-mongodb
never ending cycle, while querying
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 1.7k
- Forks
- 1.1k
- PR merge metrics
- No merged PRs in 30d
Description
- it's causing never ending cycle on 3.1.5 - spring boot:
@Query("{profile.$id: :profileId}")
Optional findUserByProfile(@Param("profileId") UUID profileId);
commenting out the query works:
//@Query("{profile.$id: :profileId}")
Optional findUserByProfile(@Param("profileId") UUID profileId);
Not sure, why it's behaving in this way, but it shouldn't blow up any server!
It should override the normal behaviour as default, shouldn't be fiddling with the binding, and call itself 1M times, should throw exception!
- the follwing syntax also was working before:
[
{
"$match": {
"$elemMatch": {
"profiles.$id": {
"$in": [
":#{#profileIds}"
]
}
}
}
}
]
Now, it's neither accepting profiles.$id nor does return back anything
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the findUserByProfile repository query on Spring Boot 3.1.5 with the provided @Query and @Param examples, then compare it with the commented-out method and aggregation syntax. Trace the query binding and execution path to identify the cycle; done means the query no longer loops indefinitely and the documented profiles.$id form either works or fails with a clear exception.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, mongodb, spring-boot
- Domain
- backend, database
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100