# Get entries with range?

**URL:** <https://discourse.getcockpit.com/t/get-entries-with-range/42>\
**Category:** Support\
**Created:** [May 3, 2018, 11:49am UTC](https://discourse.getcockpit.com/t/get-entries-with-range/42 "2018-05-03T11:49:02Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![artur](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.getcockpit.com/artur/32/4_2.png) [@artur](https://discourse.getcockpit.com/u/artur)\
**Post date:** [May 3, 2018, 1:19pm UTC](https://discourse.getcockpit.com/t/get-entries-with-range/42/4 "2018-05-03T13:19:57Z")

</div>

```auto
fetch('/api/collections/get/posts?token=xxtokenxx', {
    method: 'post',
    headers: { 'Content-Type': 'application/json' },
    body: JSON.stringify({
        filter: {
             $and: [
               {myfield: {$gt: x}},
               {myfield: {$lt: y}}
             ]
        }
    })
})
.then(res=>res.json())
.then(res => console.log(res));

```

---

_[View the full topic](https://discourse.getcockpit.com/t/get-entries-with-range/42)._
