Skip to content

Commit 77794a2

Browse files
committed
Fixes
1 parent a5e05b8 commit 77794a2

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

articles/cosmos-db/sql/create-sql-api-nodejs.md

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ ms.service: cosmos-db
66
ms.subservice: cosmosdb-sql
77
ms.devlang: javascript
88
ms.topic: quickstart
9-
ms.date: 09/15/2022
9+
ms.date: 09/21/2022
1010
ms.author: sidandrews
1111
ms.reviewer: mjbrown
1212
ms.custom: devx-track-js, mode-api
@@ -186,19 +186,17 @@ The partition key is specific to a container. In this Contoso Products container
186186

187187
Add the following code to query for all items that match a specific filter. Create a [parameterized query expression](/javascript/api/@azure/cosmos/sqlqueryspec) then call the [``Container.Items.query``](/javascript/api/@azure/cosmos/items#@azure-cosmos-items-query) method. This method returns a [``QueryIterator``](/javascript/api/@azure/cosmos/queryiterator) that will manage the pages of results. Then, use a combination of ``while`` and ``for`` loops to [``fetchNext``](/javascript/api/@azure/cosmos/queryiterator#@azure-cosmos-queryiterator-fetchnext) page of results as a [``FeedResponse``](/javascript/api/@azure/cosmos/feedresponse) and then iterate over the individual data objects.
188188

189-
```sql
190-
SELECT * FROM todo t WHERE t.partitionKey = 'Bikes, Touring Bikes'
191-
```
189+
The query is programmatically composed to `SELECT * FROM todo t WHERE t.partitionKey = 'Bikes, Touring Bikes'`.
192190

193-
:::code language="javascript" source="~/cosmos-db-sql-api-javascript-samples/001-quickstart/index.js" range="97-127":::
191+
:::code language="javascript" source="~/cosmos-db-sql-api-javascript-samples/001-quickstart/index.js" range="97-114":::
194192

195193
If you want to use this data returned from the FeedResponse as an _item_, you need to create an [``Item``](/javascript/api/@azure/cosmos/item), using the [``Container.Items.read``](#get-an-item) method.
196194

197195
### Delete an item
198196

199197
Add the following code to delete an item you need to use the ID and partition key to get the item, then delete it. This example uses the [``Container.Item.delete``](/javascript/api/@azure/cosmos/item#@azure-cosmos-item-delete) method to delete the item.
200198

201-
:::code language="javascript" source="~/cosmos-db-sql-api-javascript-samples/001-quickstart/index.js" range="129-131":::
199+
:::code language="javascript" source="~/cosmos-db-sql-api-javascript-samples/001-quickstart/index.js" range="116-118":::
202200

203201
## Run the code
204202

0 commit comments

Comments
 (0)