diff --git a/src/test/java/io/stargate/sgv2/jsonapi/api/v1/tables/FindOneTableIntegrationTest.java b/src/test/java/io/stargate/sgv2/jsonapi/api/v1/tables/FindOneTableIntegrationTest.java index 91b694f49..e1d3d06db 100644 --- a/src/test/java/io/stargate/sgv2/jsonapi/api/v1/tables/FindOneTableIntegrationTest.java +++ b/src/test/java/io/stargate/sgv2/jsonapi/api/v1/tables/FindOneTableIntegrationTest.java @@ -261,8 +261,49 @@ public void findOneDocIdKey() { .hasJSONField("data.document", removeNullValues(DOC_B_JSON)); } + // for [data-api#1532] @Test @Order(4) + public final void documentIdWith$in() { + final String TABLE_NAME = "findOneIdAndDollarInTable"; + assertNamespaceCommand(keyspaceName) + .templated() + .createTable( + TABLE_NAME, + Map.of( + "_id", "text", + "value", "int"), + "_id") + .wasSuccessful(); + + // First, insert 2 documents: + String DOC_A_JSON = "{ \"_id\": \"a\", \"value\": 12 }"; + assertTableCommand(keyspaceName, TABLE_NAME) + .templated() + .insertOne(DOC_A_JSON) + .wasSuccessful(); + + String DOC_B_JSON = "{ \"_id\": \"b\", \"value\": 23 }"; + assertTableCommand(keyspaceName, TABLE_NAME) + .templated() + .insertOne(DOC_B_JSON) + .wasSuccessful(); + + assertTableCommand(keyspaceName, TABLE_NAME) + .postFindOne( + """ + { + "filter": { + "_id": { "$in": ["b", "c"] } + } + } + """) + .wasSuccessful() + .hasJSONField("data.document", DOC_B_JSON); + } + + @Test + @Order(5) public final void sparseDataForCollectionDataType() { String tableName = "mapListSet"; String tableJson =