Skip to content
Daniel Wagner edited this page Jun 24, 2022 · 10 revisions

NoSQL Schema

// Collection
"gameData": {
	//Document
        "(reference) collection/games/doc/gameId": {
            // Collection
            "actions": {
                // Document
                "actionId": {
                    "teamId":(reference) collection/teams/doc/{teamId},
                    "gameId":(reference) collection/games/doc/{gameId},
                    "playerId":(reference) collection/players/doc/{playerId},
                    "type":(string) "attack" or "defense",
                    "actionType":(string) i.e. "goal",
                    "throwLocation":(string) i.e. "sector 3 and not in 6m and not in 9m",
                    "timestamp":(number) unix time i.e. 1653904889704,
                    "relativeTime": (number) seconds since game start
                }  
                ...    
            }
        }
       ...
    }
}

// Collection
"players"{
	// Document
	"playerId"{
		"firstName": (string) i.e. "Tobias",
                "lastName": (string) i.e. "Buck",
                "nickName": (string) i.e. "Toby",
		"club": (reference) collection/teams/doc/{clubId},
                "teams": (array) [(string) i.e. "teams/{teamId}"],
		"games": (array) [ (reference) collection/games/{gameId}, ...]
		"positions": (array) [ (string) position_a, ...],
                "number": (number) i.e. 11
	}
	...
}

// Collection
"teams"{
	// Document
	"teamId"{
                "clubId": (reference) collection/clubs/doc/{clubId},
		"name": (string) i.e. "A Jugend",
		"players": (array) [ (reference) /players/{playerId}, ...],
                "onFieldPlayers": (array) [ (reference) /players/{playerId}, ...],
                "type": (string) "men" or "women" or "youth"
	}
	...
}

// Collection
"games"{
	// Document
	"gameId"{
		"date": date,
		"club": clubId,
		"starttime": unix timestamp,
		"stoptime": unix timestamp,
		"score":number,
		"scoreOpponent":number,
		"players": (array) [(string) playerId_a, (string) playeId_b, ...]
	}
	...
}

Resources

Clone this wiki locally