Permalink
Fetching contributors…
Cannot retrieve contributors at this time
31 lines (23 sloc) 999 Bytes

0.4.3

  • features
    • added "size" filter comparison for a grasshopper query. The "size" operator matches any array with the number of elements specified by the argument.
    • added "exists" filter comparison for a grasshopper query. You can check and see if specific fields exist in your data.

For example:

// The provided example will return all rows that have 0 actors.
grasshopper.request(token).content.query({
    filters: [{
        key: 'field.actors', cmp: 'size', value: 0
    }]
});

// The provided example will return all results that contain an actors field
grasshopper.request(token).content.query({
    filters: [{
        key: 'field.actors', cmp: 'exists', value: true
    }]
});

// The provided example will return all results that contain at least 1 actor in an array
grasshopper.request(token).content.query({
    filters: [{
        key: 'field.actors.1', cmp: 'exists', value: true
    }]
});