azure-cosmos-js/samples
Christopher Anderson 2ac677b7db
Add change feed support (#196)
* Change feed support

* typos, PR feedback, fix StartTime test coverage

* add retries to flaky test

* Adds jsdoc, changes response type, and adjusts feed options

* Add change feed sample

* PR feedback

* pr feedback

* remove partitionkeyrange support and dedupe PK

* Fix session test
2018-12-03 11:56:33 -08:00
..
ChangeFeed Add change feed support (#196) 2018-12-03 11:56:33 -08:00
ContainerManagement Update samples to new OM (#79) 2018-07-30 16:39:34 -07:00
DatabaseManagement Update samples to new OM (#79) 2018-07-30 16:39:34 -07:00
IndexManagement Change all string enum properties to keyof typof enum properties (#86) 2018-07-31 11:59:16 -07:00
ItemManagement Added missing example 6 demoing upserts (#136) 2018-09-24 07:50:59 -07:00
MultiRegionWrite Multi-Region Write support (#106) 2018-09-20 18:27:04 -07:00
ServerSideScripts console log database and collection deletion (#158) 2018-10-10 11:26:14 -04:00
Shared Add change feed support (#196) 2018-12-03 11:56:33 -08:00
TodoApp Update samples to new OM (#79) 2018-07-30 16:39:34 -07:00
UserManagement Update samples to new OM (#79) 2018-07-30 16:39:34 -07:00
readme.md Update samples to new OM (#79) 2018-07-30 16:39:34 -07:00

readme.md

Introduction

These samples demonstrate how to use the Node.js SDK to interact with the Azure Cosmos DB service

Running the samples

Quick steps:

  1. Start the Cosmos DB emulator
  2. cd into a given sample's directory
  3. npm start

Debugging

These samples were built using VS Code and includes a .vscode/launch.json. However, you do not need anything other than Node.js to run these samples. Just run the app.js in your choice of editor or terminal.

To debug in VS Code, just use the "Debug File" option, and start it in the sample's app.js of your choice. (For the TodoApp, you need to start from bin/www)

Cosmos Account

Before you can run any of the samples you do need an active Azure Cosmos DB account or the emulator. Head over to How to create a Azure Cosmos DB database account and see how to setup your account. Check out the emulator (windows only at the moment) here.

Description

Azure Cosmos DB is a fully managed, scalable, query-able, schema free JSON document database service built for modern applications and delivered to you by Microsoft.

These samples demonstrate how to use the Client SDKs to interact with the service.

  • CollectionManagement - CRUD operations on DocumentCollection resources.

  • DatabaseManagent - CRUD operations on Database resources.

  • DocumentManagement - CRUD operations on Document resources.

  • IndexManagement - shows samples on how to customize the Indexing Policy for a Collection should you need to.

  • Partitioning - shows samples on using the provided hashPartitionResolver and rangePartitionResolver classes, and how to implement custom resolvers.

  • ServerSideScripts - shows how to create, and execute, server-side stored procedures, triggers and user-defined functions.

  • TodoApp - Quick and simple todo app.

After walking through these samples you should have a good idea of how to get going and how to make use of the various Azure Cosmos DB APIs.

There are step-by-step tutorials and more documentation on the Azure Cosmos DB documentation page so head over about this NoSQL document database.

More information

For more information on this database service, please refer to the Azure Cosmos DB service page.