MongodbSerializer need update for IN/NOT_IN operation for @DBRef
See original GitHub issueI am using spring boot 1.5.2.RELEASE and querydsl-mongodb 4.1.4. Found this:
@Document
public class User {
@DBRef
private Addr addr;
}
and query like this:
List<Addr> addrList = ...;
return userRepo.findAll(Expressions.allOf(
QUser.user.addr.notIn(addrList) // ONLY worked when addrList.size() == 1
))
this may refered to MongodbSerializer#visit(Operation<?> expr, Void context) which not invoke convert
properbly?
So, could this be fixed ? or give some other alternative way?
PS: current I using this :
// groovy code
List<BooleanExpression> neAddrs = addrList.findResults { QUser.user.addr.ne(it) }.toList()
return userRepo.findAll(allOf(
allOf((BooleanExpression[]) neAddrs.toArray())
))
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:9
Top Results From Across the Web
MongoDB Java - List<DBRef> update is causing existing ...
I have a 3 node mongo 4.0.27 replica set with 1 primary and 2 secondary nodes. I am executing a Push operation on...
Read more >How to query mongodb with DBRef - Stack Overflow
In using large collections you will want to index the field and query it using the below method. If you want to use...
Read more >Create DBRefs in MongoDB - Navicat
Using the New DBRefs. Now that we've updated our an employee document to use DBRefs, we will have to alter how we go...
Read more >Update fails when query contains part of a DBRef and results ...
When the update query contains a partial DBRef ($id / $ref / $db) with ... The upsert fails but no other operations are...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I know none right of the top of my head - we tried a while ago (see: issue branch for DATAMONGO-1810) but it turned out to be insufficient and work only under certain circumstances. If you happen to find a solution a PR would be warmly welcome.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.