# Query with -whereKey:containedIn: cannot use excludeKey

**URL:** <https://community.parseplatform.org/t/query-with-wherekey-cannot-use-excludekey/3831>\
**Category:** iOS SDK 📱⌚️💻\
**Created:** [February 13, 2024, 9:05pm UTC](https://community.parseplatform.org/t/query-with-wherekey-cannot-use-excludekey/3831 "2024-02-13T21:05:52Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dhoerl](https://community.parseplatform.org/user_avatar/community.parseplatform.org/dhoerl/32/1719_2.png) [@dhoerl](https://community.parseplatform.org/u/dhoerl)\
**Post date:** [February 13, 2024, 9:05pm UTC](https://community.parseplatform.org/t/query-with-wherekey-cannot-use-excludekey/3831/1 "2024-02-13T21:05:52Z")

</div>

My goal is to get a subset of items contained on the server using “whereKey"objectId” containedIn:", but exclude a related Parse object "Company:.

When I add "excludeKey:“company” to my query, it gets kicked back with an error saying “Invalid Parameter”.

Is there some clever way to make this work? Like use +andQueryWithSubqueries:, or possible add a slew of subqueries, one each for one of the items I want (in that case whereKey isEqualTo.?

Any pointers would be useful!

Its my opinion right now that my query is taking a long time since it has to fetch and attach the Company object to reach returned item - those are large objects too!.

---

<div class="post-metadata">

**Author:** ![dhoerl](https://community.parseplatform.org/user_avatar/community.parseplatform.org/dhoerl/32/1719_2.png) [@dhoerl](https://community.parseplatform.org/u/dhoerl)\
**Post date:** [February 15, 2024, 2:53pm UTC](https://community.parseplatform.org/t/query-with-wherekey-cannot-use-excludekey/3831/2 "2024-02-15T14:53:21Z")

</div>

EDIT: excludeKey doesn’t work on any queries. Going to post an issue on the GitHub site shortly.
