# Send data through Live Query to the server

**URL:** <https://community.parseplatform.org/t/send-data-through-live-query-to-the-server/3816>\
**Category:** JavaScript SDK\
**Tags:** live-query\
**Created:** [January 22, 2024, 3:26pm UTC](https://community.parseplatform.org/t/send-data-through-live-query-to-the-server/3816 "2024-01-22T15:26:00Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ali\_pro](https://community.parseplatform.org/letter_avatar_proxy/v4/letter/a/b19c9b/32.png) [@ali\_pro](https://community.parseplatform.org/u/ali_pro)\
**Post date:** [January 22, 2024, 3:26pm UTC](https://community.parseplatform.org/t/send-data-through-live-query-to-the-server/3816/1 "2024-01-22T15:26:01Z")

</div>

Hello Parsers!  
I’m trying to create a react chat application using parse server and JS SDK. There’s something I can’t figure out. I want to implement the feature of messages getting seen. Does JS SDK’s live query support updating database like the objects? Or I need to listen for incoming websocket messages on server through cloud code?

---

<div class="post-metadata">

**Author:** ![rgunindi](https://community.parseplatform.org/user_avatar/community.parseplatform.org/rgunindi/32/1553_2.png) [@rgunindi](https://community.parseplatform.org/u/rgunindi)\
**Post date:** [January 22, 2024, 8:46pm UTC](https://community.parseplatform.org/t/send-data-through-live-query-to-the-server/3816/2 "2024-01-22T20:46:24Z")

</div>

> [@ali\_pro](#):
>
> . There’s something I can’t figure out. I want to implement the feature of messages getting seen. Does JS SDK’s live query support updating database like the objects? Or I need to listen for incoming websocket messages on server through cloud code?

Yes, you can listen on the server side and do it anything!

---

<div class="post-metadata">

**Author:** ![ali\_pro](https://community.parseplatform.org/letter_avatar_proxy/v4/letter/a/b19c9b/32.png) [@ali\_pro](https://community.parseplatform.org/u/ali_pro)\
**Post date:** [January 22, 2024, 9:03pm UTC](https://community.parseplatform.org/t/send-data-through-live-query-to-the-server/3816/3 "2024-01-22T21:03:00Z")

</div>

Would you let me know how? Perhaps starting by a cloud function. So what’s inside it? Just a server instance that listens to ws port? Wouldn’t it interfere with live query?

---

<div class="post-metadata">

**Author:** ![rgunindi](https://community.parseplatform.org/user_avatar/community.parseplatform.org/rgunindi/32/1553_2.png) [@rgunindi](https://community.parseplatform.org/u/rgunindi)\
**Post date:** [January 22, 2024, 9:50pm UTC](https://community.parseplatform.org/t/send-data-through-live-query-to-the-server/3816/4 "2024-01-22T21:50:47Z")

</div>

Or you can use the afterFind hook, when the user reaches the messages you can directly change the messages seen field.

You can improve the code for your project requirement.

```auto
Parse.Cloud.afterFind('messageCollection', async req => {
  const message = req.objects;
    if (message.get('receiver') == req.user.id) {
     await message.set('seen', true).save();
    }
  return message;
});

```
