[PATCH] Fix find()'s docs on nested subconditions

The documentation says that you need to write (P & Q) | R
like this:

{
    'conditions': [
        {
            'query': {
                'conditions': [P, Q],
                'operator': '&'
            }
        },
        R
    ],
    'operator': '|'
}

but actually you need to omit the { 'query': ... } wrapping the
subclause. Including it crashes parseCondition() at:

    v = condition['value']

for the obvious reason.
This commit is contained in:
Will Thompson 2015-03-05 14:17:02 +05:30 committed by j
parent 58f6c9901d
commit 9ac5dc7ba9

View file

@ -112,10 +112,8 @@ def find(request, data):
operator: string, // comparison operator, see below operator: string, // comparison operator, see below
value: string // value value: string // value
}, { // ... and/or query objects (nested subconditions) }, { // ... and/or query objects (nested subconditions)
query: { conditions: [object, ...], // list of condition objects
conditions: [object, ...], // list of condition objects operator: string // logical operator, '&' or '|'
operator: string // logical operator, '&' or '|'
}
}], }],
operator: string // logical operator, '&' or '|' operator: string // logical operator, '&' or '|'
}, },