# Elastic node js client point in time syntax

**URL:** <https://discuss.elastic.co/t/elastic-node-js-client-point-in-time-syntax/267903>\
**Category:** Elasticsearch\
**Created:** [March 21, 2021, 10:13am UTC](https://discuss.elastic.co/t/elastic-node-js-client-point-in-time-syntax/267903 "2021-03-21T10:13:57Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![111452](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/111452/32/79499_2.png) [@111452](https://discuss.elastic.co/u/111452)\
**Post date:** [March 21, 2021, 10:13am UTC](https://discuss.elastic.co/t/elastic-node-js-client-point-in-time-syntax/267903/1 "2021-03-21T10:13:58Z")

</div>

Can someone show me the right syntax for using point in time in elastic search on node js client. I'm trying like this:

```auto
const body = {
      query: {
        geo_shape: {
          geometry: {
            relation: 'within',
            shape: {
              type: 'polygon',
              coordinates: [$polygon],
            },
          },
        },
      },
      pit: {
        id: "t_yxAwEPZXNyaS1wYzYtMjAxN3IxFjZxU2RBTzNyUXhTUV9XbzhHSk9IZ3cAFjhlclRmRGFLUU5TVHZKNXZReUc3SWcAAAAAAAALmpMWQkNwYmVSeGVRaHU2aDFZZExFRjZXZwEWNnFTZEFPM3JReFNRX1dvOEdKT0hndwAA",
        keep_alive: "1m",
      },
    };
    return client.search({
      body: body,
    } 

```

and it gives me search\_phase\_execution\_exception  
This query works fine in Kibana so I guess the problem is in syntax.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [April 18, 2021, 10:14am UTC](https://discuss.elastic.co/t/elastic-node-js-client-point-in-time-syntax/267903/2 "2021-04-18T10:14:00Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
