Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Add an item to the Cosmos DB from Node.js
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);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.