Search code examples
apigee

How to query APIGEE for missing attribute


I need to find all entities in a collection that don't have a location associated with them. How does one do this?

Thanks in advance.


Solution

  • If you are looking for a property that may or may not be there, the best way to approach this is to always add a default value for the property. For example

    POST /cats {"property_that_may_or_may_not_exist":"default"}

    Then update the property when it needs to exist. If it doesn't exist yet, you can query with a positive match:

    GET /cats?ql=select * where property_that_may_or_may_not_exist=default

    In other words, the property is always there, it simply has a "false" value.