You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
674 B
32 lines
674 B
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;
|
|
|