Skip to content

[BUG] IN query statement currently does not work with Long values #36209

Description

@rinatmini

Spring Data Azure Cosmos DB (v5.3.0 & Java17)

The result of the following query did not match the expectations.
Define method at DataClassRepository:

@Query("select * from c where c.val in ( @val )")
List<DataEntity> queryNg(@Param("val") List<Long> val);

call mathod at ApplicationClass#run:
List<DataEntity> ngList = dataRepository.queryNg(Arrays.asList(Long.valueOf(1)));

Expected to receive one result, but instead received zero results. If the query is executed to match only one id instead of specifying multiple ids with the in clause it's returned the expected result.

The main question is whether there is a way to use numeric values such as Long in the filter condition of a query that includes the "in" clause.

Main suspects that the issue occurred because the filter is internally treated as a string.

Metadata

Metadata

Labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

Status
Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions