Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[nosql-dev] mongodb $elemMatch jnosql query equivalent

Hello,

Is there any possibility to query elements in the array via jnosql query?

I have (an example) data like:

{ "measures": [
    { "id": "weight", "value": 80},
    { "id": "height", "value": 180}
  ]
}

The mongodb query for this would look like:
db.person.find({"measures": {"$elemMatch": {"id": "weight", "value": 180}}});

The only query I found to do in jnosql is something like:
select * from person where measures.id = "weight" and measures.value = 180

Which is wrong as it found the person object that match.
Any even hacky solution would be welcome.

Cheers,

Dmitry






Back to the top