Converting game.js to mongoose model