In order to store details of each game in the platform, we will implement a Mongoose model to define a Game model, and the implementation will be similar to other Mongoose model implementations covered in previous chapters, such as the Course model defined in Chapter 6, Building a Web-Based Classroom Application. In Chapter 13, Developing a Web-Based VR Game, the Game data structure section laid out the details needed for each game in order to implement the scavenger-hunt features defined for the gameplay.
We will design the game schema based on these specific details about the game, its VR objects, and also a reference to the game maker. In the following sections, we will discuss the specifics of the game schema, the sub-schema for storing individual VR objects that will be a part of the game, and the validation check to ensure a minimum number of VR...