Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question: Find parent node with multiple match #50

Open
ecuation opened this issue Sep 24, 2017 · 0 comments
Open

Question: Find parent node with multiple match #50

ecuation opened this issue Sep 24, 2017 · 0 comments

Comments

@ecuation
Copy link

Hi and thanks for your work,

I have one question, but I don't know if this is possible. I'm trying to make a query getting 2 matches in an JSON node, this is my case:

`let data = [{
"source_language": {"id": 1, "name": "English", "iso": "en"},
"target_language": {"id": 2, "name": "Afar", "iso": "aa"}
}, {
"source_language": {"id": 1, "name": "English", "iso": "en"},
"target_language": {"id": 5, "name": "Amharic", "iso": "am"}
}, {
"source_language": {"id": 27, "name": "Spanish", "iso": "es"},
"target_language": {"id": 23, "name": "German", "iso": "de"}
}, {
"source_language": {"id": 27, "name": "Spanish", "iso": "es"},
"target_language": {"id": 5, "name": "Amharic", "iso": "am"}
}, {
"source_language": {"id": 27, "name": "Spanish", "iso": "es"},
"target_language": {"id": 8, "name": "Aymara", "iso": "ay"}
}];

    let res = jsonQuery(['source_language[id=?] & target_language[id=?]', 27, 23], {
        data: data
    }).value; //  I've tried to do this, but I have no success... maybe I'm doing a wrong query.

    console.log(res);`

So, I would like to get the node that matches with source_language.id = 27 and target_language.id = 23, is that possible?

Thanks in advance :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant