Announcement Announcement Module
Collapse
No announcement yet.
Example of using elemMatch criteria Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Example of using elemMatch criteria

    How would one write this query using spring-data-mongo?

    > db.temp.find({b: {$elemMatch: {$gte: 4, $lte: 5}}})

    I am trying:
    Criteria rangeValuesCriteria = new Criteria("b").elemMatch(new Criteria("b").gte(4).and("b").lte(5));

    but that's coming out as:
    "b" : { "$elemMatch" : { "b" : { "$lte" : 5}}}

    Any help is greatly appreciated!

    Cheers
    bjorn
Working...
X