[PDB-163] Array/list support for "IN" operator for matching against a list of possible items Created: 2013/12/04  Updated: 2016/03/17  Resolved: 2015/12/15

Status: Closed
Project: PuppetDB
Component/s: None
Affects Version/s: None
Fix Version/s: PDB 4.0.0

Type: New Feature Priority: Normal
Reporter: redmine.exporter Assignee: Unassigned
Resolution: Fixed Votes: 1
Labels: redmine
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Epic Link: API evolution Phase 1
Story Points: 5
Sprint: PuppetDB 2015-12-16


When you have a array to match for it would be nice if you could use it directly with the in operator instead of having to do lots of 'or' statements.

For example, if I want to fetch the facts foo1, foo2, foo3, foo4 & foo5 in the current API this needs:

["or", ["=", "name", "foo1"], ["=", "name", "foo2"], ["=", "name", "foo3"], ["=", "name", "foo4"], ["=", "name", "foo5"]]

With a array/list operator this could instead be:

["in", "name", ["array", ["foo1", "foo2", "foo3", "foo4", "foo5"]]]

Comment by Erik Dalén [ 2014/04/23 ]

the "in" operator already exists, so this was meant to say array/list operator. Like in that example: ["in", "name", ["array", ["foo1", "foo2", "foo3", "foo4", "foo5"]]]

Comment by Wyatt Alt [ 2015/11/19 ]

This is going to be important for HA to reduce the number of requests a PDB makes during initial sync.

Generated at Mon Sep 23 13:07:01 PDT 2019 using JIRA 7.7.1#77002-sha1:e75ca93d5574d9409c0630b81c894d9065296414.