[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [nosql-dev] mongodb $elemMatch jnosql query equivalent
|
Great!
Thank you, I used DocumentTemplate and was thinking about
Criteria extension API, but direct query is a quick and good fix.
IMHO, the search in the arrays is the basic functionality
independently of any document model.
Thank you again,
Dmitry
On 5/13/2023 8:44 AM, Otavio Santana
wrote:
Hey Dmitry, how are
you?
You can use the
Filter directly if you use the MongoDBTemplate
,
you can check the MongoDB readme.
@Inject
MongoDBTemplate template;
...
Bson filter = eq("name", "Poliana");
Stream<Person> stream = template.select(Person.class , filter);
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.
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
_______________________________________________
nosql-dev mailing list
nosql-dev@xxxxxxxxxxx
To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/nosql-dev
--
--