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": [ { "player": { "nickName": "EnzoTheGreatest", "country": "Italy...