quarkus-mongodb-panache: How to query a repository for values stored in a Map ? #38753
Replies: 6 comments
-
/cc @FroMage (panache), @loicmathieu (mongodb,panache) |
Beta Was this translation helpful? Give feedback.
-
Waiting for a better suggestion, I came to the following implementation of my use case. Given the
and the repository below:
I implemented it as follows:
The problem I have here is Many thanks in advance. |
Beta Was this translation helpful? Give feedback.
-
Anyone concerned there please ? |
Beta Was this translation helpful? Give feedback.
-
I think your map is stored as a MongoDB subdocument so you can do something like that:
You can you query your MongoDB database from mongos or something like that to confirm that. |
Beta Was this translation helpful? Give feedback.
-
As it's not an issue but a question, I'll move it to Github discussion. |
Beta Was this translation helpful? Give feedback.
-
/cc @FroMage (panache), @loicmathieu (mongodb,panache) |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Describe the bug
This isn't a bug but a question and I'm asking it here 'cause I don't want to open a
stackoverflow
account.I have a
Document
as shown below:and I want to query it based on an attribute, i.e. a pair of String instances
<key, value>
. So, given the repository:I want to query it something like this:
Of course, the
in
operator works for lists but I don't find anything related to maps. Is there any way that I could do that ?Many thanks in advance.
Kind regards,
Nicolas
Expected behavior
Would have hoped to find the equivalent of the
in
operator working for maps.Actual behavior
Failed to find such an operator.
How to Reproduce?
No reproducer required as that's just a question.
Output of
uname -a
orver
$ uname -a Linux nicolas-XPS-15-9570 5.15.0-92-generic #102-Ubuntu SMP Wed Jan 10 09:33:48 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
Output of
java -version
java -version java version "17.0.6" 2023-01-17 LTS Java(TM) SE Runtime Environment (build 17.0.6+9-LTS-190) Java HotSpot(TM) 64-Bit Server VM (build 17.0.6+9-LTS-190, mixed mode, sharing
Quarkus version or git rev
3.0.4.Final
Build tool (ie. output of
mvnw --version
orgradlew --version
)mvn -version Apache Maven 3.9.5 (57804ffe001d7215b5e7bcb531cf83df38f93546) Maven home: /opt/apache-maven-3.9.5 Java version: 17.0.6, vendor: Oracle Corporation, runtime: /usr/lib/jvm/jdk-17 Default locale: en_US, platform encoding: UTF-8 OS name: "linux", version: "5.15.0-92-generic", arch: "amd64", family: "unix"
Additional information
None
Beta Was this translation helpful? Give feedback.
All reactions