Skip to content

Commit 8e1abf7

Browse files
committed
edits
1 parent 4a0121d commit 8e1abf7

File tree

3 files changed

+23
-12
lines changed

3 files changed

+23
-12
lines changed

articles/cosmos-db/nosql/how-to-javascript-create-container.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,21 @@ Once created, the URI for a container is in this format:
3636
Get a [Database](how-to-javascript-create-database.md) object, then create a [Container](/javascript/api/@azure/cosmos/container):
3737

3838
* [createIfNotExists](/javascript/api/@azure/cosmos/containers#@azure-cosmos-containers-createifnotexists) - Creates a container if it doesn't exist. If it does exist, return container.
39-
* [create](/javascript/api/@azure/cosmos/containers#@azure-cosmos-containers-create) - Creates a container if it doesn't already exist. If it does exist, return error statusCode.
39+
* [create](/javascript/api/@azure/cosmos/containers#@azure-cosmos-containers-create) - Creates a container. If it does exist, return error statusCode.
4040

4141
```javascript
4242
const containerName = 'myContainer';
4343

44-
// Create or get existing container
44+
// Possible results:
45+
// Create then return container
46+
// Return existing container
47+
// Return error statusCode
4548
const { statusCode, container } = await database.containers.createIfNotExists({ id: containerName });
4649

47-
// Create or return error
50+
// Possible results:
51+
// Create then return container
52+
// Return error statusCode, reason includes container already exists
53+
4854
const { statusCode, container} = await database.containers.create({ id: containerName });
4955
```
5056

articles/cosmos-db/nosql/how-to-javascript-create-database.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,20 @@ Once created, the URI for a database is in this format:
3636
Once you create the [CosmosClient](/javascript/api/@azure/cosmos/cosmosclient), use the client to create a [Database](/javascript/api/@azure/cosmos/database) from two different calls:
3737

3838
* [createIfNotExists](/javascript/api/@azure/cosmos/databases#@azure-cosmos-databases-createifnotexists) - Creates a database if it doesn't exist. If it does exist, return database.
39-
* [create](/javascript/api/@azure/cosmos/databases#@azure-cosmos-databases-create) - Creates a database if it doesn't already exist. If it does exist, return error statusCode.
39+
* [create](/javascript/api/@azure/cosmos/databases#@azure-cosmos-databases-create) - Creates a database. If it does exist, return error statusCode.
4040

4141
```javascript
4242
const databaseName = 'myDb';
4343

44-
// Create or get existing database
44+
// Possible results:
45+
// Create then return database
46+
// Return existing database
47+
// Return error statusCode
4548
const {statusCode, database } = await client.databases.createIfNotExists({ id: databaseName });
4649

47-
// Create or return error status code
50+
// Possible results:
51+
// Create then return database
52+
// Return error statusCode, reason includes database already exists
4853
const {statusCode, database } = await client.databases.create({ id: databaseName });
4954
```
5055

articles/cosmos-db/nosql/how-to-javascript-create-item.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ When referencing the item using a URI, use the system-generated *resource identi
6161
Create an item with the container's [items](/javascript/api/@azure/cosmos/container#@azure-cosmos-container-items) object using the [create](/javascript/api/@azure/cosmos/items) method.
6262

6363
```javascript
64-
const { statusCode, item, resource, activitId, etag} = await container.items.create({
64+
const { statusCode, item, resource, activityId, etag} = await container.items.create({
6565
id: '2',
6666
category: 'gear-surf-surfboards',
6767
name: 'Sunnox Surfboard',
@@ -75,7 +75,7 @@ const { statusCode, item, resource, activitId, etag} = await container.items.cre
7575
Replace the data with the [Item](/javascript/api/@azure/cosmos/item) object with the [replace](/javascript/api/@azure/cosmos/item#@azure-cosmos-item-replace) method.
7676

7777
```javascript
78-
const { statusCode, item, resource, activitId, etag} = await item.replace({
78+
const { statusCode, item, resource, activityId, etag} = await item.replace({
7979
id: '2',
8080
category: 'gear-surf-surfboards-retro',
8181
name: 'Sunnox Surfboard Retro',
@@ -86,18 +86,18 @@ const { statusCode, item, resource, activitId, etag} = await item.replace({
8686

8787
## Read an item
8888

89-
Read the most current data with the [Item](/javascript/api/@azure/cosmos/item) object with the [read](/javascript/api/@azure/cosmos/item#@azure-cosmos-item-read) method.
89+
Read the most current data with the [Item](/javascript/api/@azure/cosmos/item) object's [read](/javascript/api/@azure/cosmos/item#@azure-cosmos-item-read) method.
9090

9191
```javascript
92-
const { statusCode, item, resource, activitId, etag} = await item.read();
92+
const { statusCode, item, resource, activityId, etag} = await item.read();
9393
```
9494

9595
## Delete an item
9696

97-
Delete the item with the [Item](/javascript/api/@azure/cosmos/item) object with the [delete](/javascript/api/@azure/cosmos/item#@azure-cosmos-item-read) method.
97+
Delete the item with the [Item](/javascript/api/@azure/cosmos/item) object's' [delete](/javascript/api/@azure/cosmos/item#@azure-cosmos-item-read) method.
9898

9999
```javascript
100-
const { statusCode, item, activitId, etag} = await item.delete();
100+
const { statusCode, item, activityId, etag} = await item.delete();
101101
```
102102

103103
## Next steps

0 commit comments

Comments
 (0)