Skip to main content

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

Hey Dmitry, how are you?

You can use the Filter directly if you use the MongoDBTemplate, you can check the MongoDB readme.

MongoDBTemplate template;

Bson filter = eq("name", "Poliana");
Stream<Person> stream = , filter);

On Fri, May 12, 2023 at 5:00 PM Otavio Santana <otaviopolianasantana@xxxxxxxxx> wrote:
Hey Dmitry, how are you?

I hope that you are doing well.

I've included the JNoSQL discussion because what we can do is create a MongoDB extension to work with it.
Please, let me know your thoughts.

On Thu, May 11, 2023 at 1:12 PM Dmitry Repchevsky via nosql-dev <nosql-dev@xxxxxxxxxxx> wrote:


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 = "weight" and measures.value = 180

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



nosql-dev mailing list
To unsubscribe from this list, visit


Thanks a lot,

Twitter | Linkedin | Youtube


Thanks a lot,

Twitter | Linkedin | Youtube

Back to the top