findEntities doesn't handle negated id conditions #2876

Closed
opened 2016-01-27 12:43:41 +00:00 by wjt · 4 comments

Assume you have an entity with id BOC. Then:

pandora.api.findEntities({
    query: {
        conditions: [{key: 'id', operator: '!==', value: 'BOC'}]
    },
    keys: ['id']
}, Ox.print)

should return any entity except that one, but in fact it returns exactly that one. The same thing happens if you try to negate a query on any field other than type.

Patch incoming.

Assume you have an entity with id `BOC`. Then: ``` pandora.api.findEntities({ query: { conditions: [{key: 'id', operator: '!==', value: 'BOC'}] }, keys: ['id'] }, Ox.print) ``` should return any entity except that one, but in fact it returns exactly that one. The same thing happens if you try to negate a query on any field other than `type`. Patch incoming.
wjt added this to the 14.04 milestone 2016-01-27 12:43:41 +00:00
j was assigned by wjt 2016-01-27 12:43:41 +00:00
Author

Attachment 0001-findEntities-fix-negated-conditions-fixes-2876.patch (1597 bytes) added

**Attachment** 0001-findEntities-fix-negated-conditions-fixes-2876.patch (1597 bytes) added
Author

Of course you could just as well sprinkle some more branches around if you think that's clearer than breaking the function in two.

Of course you could just as well sprinkle some more branches around if you think that's clearer than breaking the function in two.
Author

Also available at https://gitlab.com/wjt/pandora.git in the 2876-findEntities branch.

Also available at <https://gitlab.com/wjt/pandora.git> in the `2876-findEntities` branch.
Owner

In 6008f3b/pandora:

#!CommitTicketReference repository="pandora" revision="6008f3b44edb47458deac9e09fb06e8a31bd27b4"
findEntities: fix negated conditions, fixes #2876
In [6008f3b/pandora](https://code.0x2620.org/0x2620/pandora/commit/6008f3b44edb47458deac9e09fb06e8a31bd27b4): ``` #!CommitTicketReference repository="pandora" revision="6008f3b44edb47458deac9e09fb06e8a31bd27b4" findEntities: fix negated conditions, fixes #2876 ```
0x2620 2016-02-05 13:31:44 +00:00
  • closed this issue
  • added the
    fixed
    label
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
0x2620/pandora#2876
No description provided.