# What type of queries does and doesn't work for live queries?

**URL:** <https://community.parseplatform.org/t/what-type-of-queries-does-and-doesnt-work-for-live-queries/1516>\
**Category:** JavaScript SDK\
**Tags:** live-query\
**Created:** [March 31, 2021, 3:01pm UTC](https://community.parseplatform.org/t/what-type-of-queries-does-and-doesnt-work-for-live-queries/1516 "2021-03-31T15:01:21Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dealerpriest](https://community.parseplatform.org/user_avatar/community.parseplatform.org/dealerpriest/32/475_2.png) [@Dealerpriest](https://community.parseplatform.org/u/Dealerpriest)\
**Post date:** [March 31, 2021, 3:01pm UTC](https://community.parseplatform.org/t/what-type-of-queries-does-and-doesnt-work-for-live-queries/1516/1 "2021-03-31T15:01:21Z")

</div>

I cant find any documentation of what types of queries doesn’t work when used as live queries. My experience is also that I won’t get any kind of error when I unintentionally create a query that will not work as expected when used as a live query.

Here is an example:

```
export async function subscribeToMessagesFromChats(chats, includeOwnMessages){
  const query = new parse.Query('ChatMessage');
  
  if(!includeOwnMessages){
    console.log('subscription to msgs without my own messages');
    const user = parse.User.current();
    query.notEqualTo('author', user);
  }

  query.containedIn('chat', chats);

  return query.subscribe();
}

```

This subscription will trigger for all messages. Even the ones that has the logged in user as ‘author’. Why?

Grateful for any help!

---

<div class="post-metadata">

**Author:** ![Dealerpriest](https://community.parseplatform.org/user_avatar/community.parseplatform.org/dealerpriest/32/475_2.png) [@Dealerpriest](https://community.parseplatform.org/u/Dealerpriest)\
**Post date:** [March 31, 2021, 3:05pm UTC](https://community.parseplatform.org/t/what-type-of-queries-does-and-doesnt-work-for-live-queries/1516/2 "2021-03-31T15:05:05Z")

</div>

Sorry for posting this question. Just now realized I posted an almost identical question some time ago. The first part of the question still stands though. How can one know what kind of queries are supported as live queries?

---

<div class="post-metadata">

**Author:** ![davimacedo](https://community.parseplatform.org/user_avatar/community.parseplatform.org/davimacedo/32/316_2.png) [@davimacedo](https://community.parseplatform.org/u/davimacedo)\
**Post date:** [March 31, 2021, 3:45pm UTC](https://community.parseplatform.org/t/what-type-of-queries-does-and-doesnt-work-for-live-queries/1516/3 "2021-03-31T15:45:28Z")

</div>

I think it should be more clear in the docs, but you can find a reference at [this link](https://github.com/parse-community/parse-server/wiki/Parse-LiveQuery-Protocol-Specification):

- The `query.where` field is mandatory. It represents the condition of the `ParseQuery` the client subscribes to. The format of the where field is the same with `ParseQuery`'s REST API format. You can check the detail [here](https://parse.com/docs/rest/guide#queries-query-constraints). Right now we support `$lt`, `$lte`, `$gt`, `$gte`, `$ne`, `$in`, `$nin`, `$exists`, `$all`, `$regex`, `$nearSphere`, `$within` and normal equal condition. Any unsupported conditions will be ignored.

---

<div class="post-metadata">

**Author:** ![davimacedo](https://community.parseplatform.org/user_avatar/community.parseplatform.org/davimacedo/32/316_2.png) [@davimacedo](https://community.parseplatform.org/u/davimacedo)\
**Post date:** [March 31, 2021, 3:46pm UTC](https://community.parseplatform.org/t/what-type-of-queries-does-and-doesnt-work-for-live-queries/1516/4 "2021-03-31T15:46:18Z")

</div>

So your code should work. If you can share a simple code reproducing the problem or even better open a failing test case to the repo, we can help to figure it out.

---

<div class="post-metadata">

**Author:** ![Dealerpriest](https://community.parseplatform.org/user_avatar/community.parseplatform.org/dealerpriest/32/475_2.png) [@Dealerpriest](https://community.parseplatform.org/u/Dealerpriest)\
**Post date:** [March 31, 2021, 5:20pm UTC](https://community.parseplatform.org/t/what-type-of-queries-does-and-doesnt-work-for-live-queries/1516/5 "2021-03-31T17:20:54Z")

</div>

I’d be willing to have a go at creating a failing test. Haven’t created a test before, what would be the procedure?  
From reading a bit in the contribution guide I guess this would involve some kind of “integration test”?

---

<div class="post-metadata">

**Author:** ![davimacedo](https://community.parseplatform.org/user_avatar/community.parseplatform.org/davimacedo/32/316_2.png) [@davimacedo](https://community.parseplatform.org/u/davimacedo)\
**Post date:** [April 1, 2021, 3:25pm UTC](https://community.parseplatform.org/t/what-type-of-queries-does-and-doesnt-work-for-live-queries/1516/6 "2021-04-01T15:25:33Z")

</div>

You can use [this test](https://github.com/parse-community/parse-server/blob/master/spec/ParseLiveQuery.spec.js#L38) as a reference, create a failing one in he same file, and open a PR.
