Skip to content

Commit 0d91039

Browse files
committed
Fixing code blocks to match code in GitHub
1 parent 9eaedd4 commit 0d91039

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -115,13 +115,13 @@ The following snippets are all taken from the _app.js_ file.
115115
- Select the "Tasks" database.
116116

117117
```javascript
118-
const database = await client.databases(databaseId);
118+
const database = client.database(databaseId);
119119
```
120120

121121
- Select the "Items" container/collection.
122122

123123
```javascript
124-
const container = await database.container(containerId);
124+
const container = database.container(containerId);
125125
```
126126

127127
- Select all the items in the "Items" container.
@@ -132,7 +132,7 @@ The following snippets are all taken from the _app.js_ file.
132132
query: "SELECT * from c"
133133
};
134134

135-
const { resources: results } = await container.items
135+
const { resources: items } = await container.items
136136
.query(querySpec)
137137
.fetchAll();
138138
```
@@ -149,15 +149,15 @@ The following snippets are all taken from the _app.js_ file.
149149
const { id, category } = createdItem;
150150

151151
createdItem.isComplete = true;
152-
const { resource: itemToUpdate } = await container
152+
const { resource: updatedItem } = await container
153153
.item(id, category)
154-
.replace(itemToUpdate);
154+
.replace(createdItem);
155155
```
156156

157157
- Delete an item
158158

159159
```javascript
160-
const { resource: result } = await this.container.item(id, category).delete();
160+
const { resource: result } = await container.item(id, category).delete();
161161
```
162162

163163
> [!NOTE]

0 commit comments

Comments
 (0)