Fixed Schemas.
This commit is contained in:
parent
6654aac896
commit
e7a1e768ee
|
@ -1,11 +1,10 @@
|
||||||
import { Schema } from 'mongoose'
|
import mongoose from 'mongoose'
|
||||||
import Level from './Level.js'
|
|
||||||
import Player from './Player.js'
|
|
||||||
|
|
||||||
const Finish = new Schema({
|
const Finish = new mongoose.Schema({
|
||||||
map: Level,
|
map: { type: mongoose.Schema.ObjectId, ref: 'Level' },
|
||||||
|
time: Number,
|
||||||
time: Date,
|
time: Date,
|
||||||
players: [Player]
|
players: [{ type: mongoose.Schema.ObjectId, ref: 'Player' }]
|
||||||
})
|
})
|
||||||
|
|
||||||
export default Finish
|
export default mongoose.model("Finish", Finish)
|
|
@ -1,14 +1,12 @@
|
||||||
import { Schema } from 'mongoose'
|
import mongoose from 'mongoose'
|
||||||
import Finish from './Finishes.js'
|
|
||||||
|
|
||||||
const Level = new Schema({
|
const Level = new mongoose.Schema({
|
||||||
name: String,
|
name: String,
|
||||||
mapper: String,
|
mapper: String,
|
||||||
release: Date,
|
release: Date,
|
||||||
category: String,
|
category: String,
|
||||||
rating: Number,
|
rating: Number,
|
||||||
awardPoints: Number,
|
awardPoints: Number
|
||||||
finishes: [Finish]
|
|
||||||
})
|
})
|
||||||
|
|
||||||
export default Level
|
export default mongoose.model("Level", Level)
|
|
@ -1,13 +1,10 @@
|
||||||
import { Schema } from 'mongoose'
|
import mongoose from 'mongoose'
|
||||||
import Level from './Level.js'
|
|
||||||
|
|
||||||
const Player = new Schema({
|
const Player = new mongoose.Schema({
|
||||||
name: String,
|
name: String,
|
||||||
points: Number,
|
points: Number,
|
||||||
rankPoints: Number,
|
rankPoints: Number,
|
||||||
teamPoints: Number,
|
teamPoints: Number
|
||||||
finishedMaps: [Level],
|
|
||||||
favouritePartners: [Player]
|
|
||||||
})
|
})
|
||||||
|
|
||||||
export default Player
|
export default mongoose.model("Player", Player)
|
Loading…
Reference in New Issue
Block a user