const mongoose = require("mongoose"); const gameSchema = new mongoose.Schema({ owner: String, player1: String, player1_name: String, player2: String, player2_name: String, channel: String, white: String, black: String, public: Boolean, started: Boolean, inviteCode: String, currentPlayer: String, missedOportunities: [String], pieces: [ { id: Number, x: Number, y: Number, player: String, type: String } ] }); const Game = mongoose.model("Game", gameSchema, "games"); // Explicitly using "products" collection module.exports = Game;