SqlQuerySpec interface
Represents a SQL query in the Azure Cosmos DB service.
Queries with inputs should be parameterized to protect against SQL injection.
Example
Parameterized SQL Query
import { SqlQuerySpec } from "@azure/cosmos";
const query: SqlQuerySpec = {
query: `SELECT * FROM Families f where f.lastName = @lastName`,
parameters: [{ name: "@lastName", value: "Wakefield" }],
};
Properties
parameters | The parameters you provide in the query |
query | The text of the SQL query |
Property Details
parameters
query
The text of the SQL query
query: string
Property Value
string