Created
October 11, 2018 07:57
-
-
Save andijakl/b450e8b6bbe86c7ea65d7c398731eac2 to your computer and use it in GitHub Desktop.
Add an item to the Cosmos DB from Node.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const newItemId = Math.floor(Math.random() * 1000 + 10).toString(); | |
let documentDefinition = { | |
"id": newItemId, | |
"name": "Angus MacGyver", | |
"state": "Building stuff" | |
}; | |
// Add a new item to the container | |
console.log("** Create item **"); | |
const createResponse = await container.items.create(documentDefinition); | |
console.log(createResponse.body); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment