1

_playerid=を含むサブドキュメント (イベントの配列) としてすべてのイベントを取得する必要があります。それsomevalueは ArangoDB の AQL で実行できますか?

サンプル ドキュメント:

{
    "livescore": {
        "league": [
            {
                "match": {
                    "home": {
                        "_goals": "2",
                        "_id": "2337787",
                        "_name": "Defensa y Justicia"
                    },
                    "away": {
                        "_goals": "3",
                        "_id": "2337780",
                        "_name": "Colon Santa FE"
                    },
                    "events": {
                        "event": [
                            {
                                "_assist": "",
                                "_assistid": "",
                                "_extra_min": "",
                                "_id": "22295244",
                                "_minute": "22",
                                "_player": "J. Tejera",
                                "_playerid": "2405930",
                                "_result": "",
                                "_team": "home",
                                "_type": "yellowcard"
                            }
                        ]
                    },
                    "ht": {
                        "_score": "[1-1]"
                    },
                    "ft": {
                        "_score": "[2-3]"
                    },
                    "_alternate_id": "4100536",
                    "_alternate_id_2": "4328174",
                    "_commentary": "True",
                    "_date": "12.05.2015",
                    "_id": "4218094",
                    "_static_id": "12051523377872337780",
                    "_status": "FT",
                    "_time": "00:10"
                },
                "_country": "argentina",
                "_name": "Argentina: Primera Division",
                "_cup": "False",
                "_id": "2914",
                "_sub_id": "29144"
            },
            {
                "match": [
                    {
                        "home": {
                            "_goals": "?",
                            "_id": "2337758",
                            "_name": "Berazategui"
                        },
                        "away": {
                            "_goals": "?",
                            "_id": "2337826",
                            "_name": "General Lamadrid"
                        },
                        "events": "",
                        "ht": {
                            "_score": ""
                        },
                        "_alternate_id": "4106986",
                        "_alternate_id_2": "4328905",
                        "_commentary": "False",
                        "_date": "12.05.2015",
                        "_id": "4224541",
                        "_static_id": "12051523377582337826",
                        "_status": "18:00",
                        "_time": "18:00"
                    },
                    {
                        "home": {
                            "_goals": "?",
                            "_id": "2337842",
                            "_name": "Justo José de Urquiza"
                        },
                        "away": {
                            "_goals": "?",
                            "_id": "2337850",
                            "_name": "Laferrere"
                        },
                        "events": "",
                        "ht": {
                            "_score": ""
                        },
                        "_alternate_id": "4106988",
                        "_alternate_id_2": "4329005",
                        "_commentary": "False",
                        "_date": "12.05.2015",
                        "_id": "4224543",
                        "_static_id": "12051523378422337850",
                        "_status": "18:00",
                        "_time": "18:00"
                    }
                ],
                "_country": "argentina",
                "_name": "Argentina: Primera C Metropolitana",
                "_cup": "False",
                "_id": "2912",
                "_sub_id": "29120"
            }
        ],
        "_updated": "12.05.2015 06:41:07",
        "_sport": "soccer"
    }
}
4

1 に答える 1

4

私はイエスと思う。テストデータでこれを試しました:

FOR d in YourData
    LET leagueList = d.livescore.league
    FOR league IN leagueList
        LET eventList = league.match.events
        FILTER !IS_NULL(eventList) 
        LET eventList2 = eventList.event
        FOR event IN eventList2
            FILTER event._playerid == "2405930"
            RETURN event

もちろん、あなたのデータモデル/問題を正しく理解しているかどうかはわかりませんが、おそらくこの例はあなたの役に立ちます.

于 2015-05-14T12:57:51.093 に答える