Skip to content

Allow using Bind Variables for or'ed conditions #60

@vmx

Description

@vmx

I'm not sure if it's a good idea or not, or if there are perhaps better ways of solving this.

When I prepared a blog post, I came across data with this shape:

{
    "fy2012": {
        "amount": 0.5,
        "netOrGross": "Gross"
    },
    "fy2013": {
        "amount": 0.2,
        "netOrGross": "Gross"
    },
    "fy2014": {
        "amount": 0.3,
        "netOrGross": "Net"
    }
}

I'd now like to sum up the amount of all years where netOrGross is Gross.

I don't see a way to do this is a single query currently.

What if I could use a Bind Variable:

find {isGross::(fy2012: {netOrGross: == "Gross"} ||
                fy2013: {netOrGross: == "Gross"} ||
                fy2014: {netOrGross: == "Gross"})}
return sum(isGross.amount)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions