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": ...

Get Guide to NoSQL with Azure Cosmos DB now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.