Player Team Stats Example

Use case - Retrieve Tom Brady Team Stats in Patriots in 2014 Regular season.

Field Selector:

{
    id,
    firstName,
    lastName,
    playerStats{teamStats{team{nickName},passingStats{attempts,completions},rushingStats{attempts,yardsPerAttempt}}}

}

Query:

{
    "$query":
        {
            "firstName" : "Tom",
            "lastName" : "Brady",
        },

    "$playerStats":{
        "$teamStats": {
            "$query": {
                "team.nickName": "Patriots",
                "game.season": 2014,
                "seasonType": "REG"
            }
        }
    }
}

Request:

GET  /persons?fs={id,firstName,lastName,playerStats{teamStats{team{nickName},passingStats{attempts,completions},rushingStats{attempts,yardsPerAttempt}}}}&s={
    "$query":{"firstName" : "Tom","lastName" : "Brady",},"$playerStats":{"$teamStats": {"$query": {"team.nickName": "Patriots","game.season": 2014,"seasonType": "REG"}}}}

Response:

{
    "pager" : {},
    "data" : [
        {
            "id": "525f365e-77fa-4e93-8413-f69705b19ade",
            "firstName": "Tom",
            "lastName" : "Brady",
            "playerStats": {
                "teamStats" : [
                    {
                        "team" : {
                            "nickName" : "Patriots"
                        },
                        "passingStats": {
                            "attempts": 10000,
                            "completions": 6800
                        },
                        "rushingStats": {
                            "attempts": 1700,
                            "yardsPerAttempt": 1
                        }
                    }
                ]
            }
        }
    ]
}