diff --git a/schemas/Finishes.js b/schemas/Finish.js similarity index 76% rename from schemas/Finishes.js rename to schemas/Finish.js index 6f75211..2d3fe69 100644 --- a/schemas/Finishes.js +++ b/schemas/Finish.js @@ -4,7 +4,7 @@ const Finish = new mongoose.Schema({ map: { type: mongoose.Schema.ObjectId, ref: 'Level' }, time: Number, time: Date, - players: [{ type: mongoose.Schema.ObjectId, ref: 'Player' }] + player: { type: mongoose.Schema.ObjectId, ref: 'Player' } }) export default mongoose.model("Finish", Finish) \ No newline at end of file diff --git a/schemas/TeamFinish.js b/schemas/TeamFinish.js new file mode 100644 index 0000000..83ae8df --- /dev/null +++ b/schemas/TeamFinish.js @@ -0,0 +1,10 @@ +import mongoose from 'mongoose' + +const TeamFinish = new mongoose.Schema({ + map: { type: mongoose.Schema.ObjectId, ref: 'Level' }, + time: Number, + time: Date, + players: [{ type: mongoose.Schema.ObjectId, ref: 'Player' }] +}) + +export default mongoose.model("TeamFinish", TeamFinish) \ No newline at end of file