Closed spring-projects-issues closed 5 years ago
Oliver Drotbohm commented
It looks like we#re not properly processing the $slice
keyword for DbRefs. In fact, I don't even think we support parameter bindings into a fields spec yet. AFAIR it's only passed throught the QueryMapper
to make sure we map the fields names properly
eacdy commented
Oliver Drotbohm Thanks a lot. I think I am gonna give up using DBRef
eacdy opened DATAMONGO-2149 and commented
I have two entities: user and company.
The relation between them are many to many.Which means one user belongs to many companies and one company may have lots of user.
Now, I want to query a user with his companies. In case this guy's companies are too many, I want to show only 5 companies in one page.
Code is like below:
WHEN I CALL endpoint /users/{id}
I Can only receive ERROR like below:
But When I use mongo client I got the result I want.
!image-2018-11-28-16-47-34-817.png!
SO I wonder Whether this is a bug, Or I used it in a wrong way.
Here goes the code:
[^odin.zip]
Affects: 2.0.12 (Kay SR12), 2.1.3 (Lovelace SR3)
Attachments:
Issue Links:
@Query
for partial DBRef expressionsReferenced from: pull request https://github.com/spring-projects/spring-data-mongodb/pull/623
Backported to: 2.1.4 (Lovelace SR4), 2.0.13 (Kay SR13), 1.10.18 (Ingalls SR18)