-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Description
Stanislav Tyurikov opened DATAMONGO-351 and commented
One of my entity contains a java.util.Map
field. After persistence it is transformed to a document like this:
{ lang:
{
Java: 1000,
Groovy: 2000,
Xml: 3000,
}
}
lang
is the name of the map field. "Java", "Groovy" and "XML" are keys in the map, 1000, 2000, 3000 - the values.
I want to create a query method on a repository instance to select documents which contain desirable key and value:
@Query(" { lang.?0 : ?1 } " )
MyEntity findByLangAndValue(String someLang, long someValue);
The problem is then parameters are mapped to a query to execute, ?0
is replaced with someLang
's value arounded with quotes. i.e. call findByLangAndValue("Java", 1000)
transformed to query: \{ lang.\"Java\" : "1000" \
} which fails to execute. Arounding a key part with quotes looks like a bug. At least it makes impossible to create query such as in my case
No further details from DATAMONGO-351