Hey everyone!
We added a new feature where you can now use the “in” or “not in” operator for searches constrained by unique ids. This means that you can now filter for unique ids that you specify in a list while doing a search, either via the data API or in the editor as a search constraint.
Previously with the data API, we did not allow for getting multiple things at once via their unique ids, since it would cause a timeout. We have now made this query much faster and more efficient, so that users can have more flexibility in the types of search queries they create. Allowing the “in” operator now means that users can quickly retrieve multiple things at once given their unique ids, or retrieve all things except for those unique ids specified.
You can specify the constraints in this format: [{"key": "_id", "constraint_type": "in", "value": [list of unique ids]}]
On the editor, users will have this same type of flexibility, but instead will also be able to create dynamic lists of unique ids directly in the search constraint field:
Wow this is a major power user feature add! Kudos!! This is going to skinny up a lot of my heavy database calls and simplify some of my workflows. Excellent Bubble – Thank you!
Sorry, but I think there is some inconsistency in your example, as it was the second query, it refers to the unique id field which naturally would never be duplicated! How would it be to choose another field to define the uniqueness of the items?
It seems that applying the “unique id is in” condition, if applied multiple times in the same search does not return any result, even if the unique id is present in all conditions. I would expect that the result would be an intersection of all ranges instead in this case.
What I mean:
Do a Search for a Thing, where
unique id is in Range X
unique id is in Range Y
Even if a unique id is present in Range X and Range Y, the result will be empty.
Am I the only one having this issue? Is the search behaving as expected and my expectation is wrong?
I am using this, what I am doing is creating some data things > and then saving the unique IDs in a custom state, which is a List of Texts.
There after I am Doing a Search for Items - where Unique ID “is in” the Custom State , it doesnt give the output.
I am trying to read this list in a Repeating Group and have some auto-binding input elements in the repeating group, so I need to modify the data of those specific data things.
Hey @sravani , there’s been a tiny bug since this feature was released, where if you pick unique id as the constraint it auto picks = and skips right to what data source you want.
So it’s a little confusing since you have to reselect = and pick “is in” or “is not in”, etc. Normally I feel this behavior is kept for when there’s only one operator choice?