microsoft / spring-data-cosmosdb

Access data with Azure Cosmos DB
MIT License
94 stars 64 forks source link

querying lists of objects #532

Closed chrisgolle closed 4 years ago

chrisgolle commented 4 years ago

Hello, i would like to write a query to find a nested property from a list of objects

{id: "id", objects: [{"prop": "val1"},{{"prop": "val2"}}]}

my query is the following:

SELECT VALUE c FROM ROOT c join d in c.objects WHERE d.prop = @prop

I can do this with a raw query, can i do it without?

kushagraThapar commented 4 years ago

Currently spring doesn't support query annotation feature, so for now the only option is to use the raw query. Here is a doc on how you can execute these raw queries in spring-data-cosmosdb : https://docs.microsoft.com/en-us/azure/developer/java/spring-framework/how-to-guides-spring-data-cosmosdb#custom-query-execution

chrisgolle commented 4 years ago

ah, okay, thank you