O'Reilly logo

Guide to NoSQL with Azure Cosmos DB by Daron Yondem, Gaston C. Hillar

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Inserting documents that represent competitions

Now we will write two methods that insert different documents that represent competitions. First, we will code a method that works with a dynamic object to insert the following JSON document that represents the first competition that has already finished. Note that the dateTime value for the document will be calculated to be 50 days before today:

{ "id": "1", "title": "Crowns for Gamers - Portland 2018", "location": { "zipCode": "90210", "state": "CA" }, "platforms": [ "PS4", "XBox", "Switch" ], "games": [ "Fortnite", "NBA Live 19" ], "numberOfRegisteredCompetitors": 80, "numberOfCompetitors": 60, "numberOfViewers": 300, "status": "Finished", "dateTime": "2018-07-23T01:25:11.0085577Z", "winners": ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required