MicrosoftDocs / azure-docs

Open source documentation of Microsoft Azure
https://docs.microsoft.com/azure
Creative Commons Attribution 4.0 International
10.21k stars 21.38k forks source link

Does SQL Parameter supports "IN"? #70531

Closed jeffpeiyt closed 3 years ago

jeffpeiyt commented 3 years ago

Does the SQL parameter support "IN"? If yes, can we add an example?

The use case is

SELECT * FROM c WHERE c.attribute IN ('value1', 'value2')

https://docs.microsoft.com/en-us/azure/cosmos-db/sql-query-keywords#in

Parameter values can be any valid JSON: strings, numbers, Booleans, null, even arrays or nested JSON. Since Azure Cosmos DB is schemaless, parameters aren't validated against any type.

Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

ChaitanyaNaykodi-MSFT commented 3 years ago

Hello @jeffpeiyt, Thank you for your feedback! We will review and update as appropriate.

jeffpeiyt commented 3 years ago

https://stackoverflow.com/questions/60933325/how-to-create-the-sqlqueryspec-in-java-in-order-to-retrieve-a-list-of-documents resolves the issue. Consider add it to the doc so that it saves people 4 hours on trying and googling.