# Inventory query with filter for "not equal"

**URL:** <https://community.cumulocity.com/t/inventory-query-with-filter-for-not-equal/7525>\
**Category:** Forum\
**Tags:** cumulocity\
**Created:** [March 3, 2021, 9:58am UTC](https://community.cumulocity.com/t/inventory-query-with-filter-for-not-equal/7525 "2021-03-03T09:58:04Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![peter.gaspar](https://dub1.discourse-cdn.com/flex005/user_avatar/community.cumulocity.com/peter.gaspar/32/31961_2.png) [@peter.gaspar](https://community.cumulocity.com/u/peter.gaspar)\
**Post date:** [March 3, 2021, 9:58am UTC](https://community.cumulocity.com/t/inventory-query-with-filter-for-not-equal/7525/1 "2021-03-03T09:58:04Z")

</div>

Hello,

I’m trying to get a list of device, that do not have a specific string in the ocnfiguration. i need to negate the eq filter, but it doesn’t seem to work.

This is what I try:  
/inventory/managedObjects?query=$filter=not (c8y\_Configuration.config eq ‘_2.1.126_’)

I get an empty list, even though there is a plenty of devices without this in config.

Am I doing something wrong?

Peter

---

<div class="post-metadata">

**Author:** ![Philipp\_Emmel](https://dub1.discourse-cdn.com/flex005/user_avatar/community.cumulocity.com/philipp_emmel/32/19455_2.png) [@Philipp\_Emmel](https://community.cumulocity.com/u/Philipp_Emmel)\
**Post date:** [March 29, 2021, 8:21am UTC](https://community.cumulocity.com/t/inventory-query-with-filter-for-not-equal/7525/2 "2021-03-29T08:21:55Z")

</div>

Hi Peter,

If you remove the single quotes from your query it works as intended. If you only want to find device and not any other types of managed objects I would also recommend using the query param ‘q’ instead. This will only return objects that also have `c8y_IsDevice`.

The final query looks like this then:

```auto
/inventory/managedObjects?q=$filter=not (c8y_Configuration.config eq 2.1.126)

```

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/flex005/user_avatar/community.cumulocity.com/system/32/31990_2.png) [@system](https://community.cumulocity.com/u/system)\
**Post date:** [February 19, 2024, 5:58pm UTC](https://community.cumulocity.com/t/inventory-query-with-filter-for-not-equal/7525/3 "2024-02-19T17:58:32Z")

</div>

This topic was automatically closed after 1083 days. New replies are no longer allowed.
