# Problem in node mongoDB aggregation

**URL:** <https://community.n8n.io/t/problem-in-node-mongodb-aggregation/49833>\
**Category:** Questions\
**Tags:** node, mongodb, n8n-node\
**Created:** [July 9, 2024, 6:31am UTC](https://community.n8n.io/t/problem-in-node-mongodb-aggregation/49833 "2024-07-09T06:31:59Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![amir](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/amir/32/42739_2.png) [@amir](https://community.n8n.io/u/amir)\
**Post date:** [July 9, 2024, 6:31am UTC](https://community.n8n.io/t/problem-in-node-mongodb-aggregation/49833/1 "2024-07-09T06:31:59Z")

</div>

i have this aggregate query and its working on my database query console  
but when I run it on n8n it will return an empty collection

I think the problem is in line 4 when I want to create a new Date() it can not understand it with this n8n JSON syntax  
can somebody help me?

---

<div class="post-metadata">

**Author:** ![n8n](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/n8n/32/196425_2.png) [@n8n](https://community.n8n.io/u/n8n)\
**Post date:** [July 9, 2024, 6:32am UTC](https://community.n8n.io/t/problem-in-node-mongodb-aggregation/49833/2 "2024-07-09T06:32:00Z")

</div>

It looks like your topic is missing some important information. Could you provide the following if applicable.

- **n8n version:**
- **Database (default: SQLite):**
- **n8n EXECUTIONS\_PROCESS setting (default: own, main):**
- **Running n8n via (Docker, npm, n8n cloud, desktop app):**
- **Operating system:**

---

<div class="post-metadata">

**Author:** ![barn4k](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/barn4k/32/8170_2.png) [@barn4k](https://community.n8n.io/u/barn4k)\
**Post date:** [July 9, 2024, 1:42pm UTC](https://community.n8n.io/t/problem-in-node-mongodb-aggregation/49833/3 "2024-07-09T13:42:04Z")

</div>

hello @amir

Don’t know if that works, but try to pass the date object:

```auto
{ "$gt": {{ DateTime.fromISO('2024-07-05T18:35:28.349Z') }} }

```

and set the query mode to Expression

---

<div class="post-metadata">

**Author:** ![amir](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/amir/32/42739_2.png) [@amir](https://community.n8n.io/u/amir)\
**Post date:** [July 9, 2024, 3:33pm UTC](https://community.n8n.io/t/problem-in-node-mongodb-aggregation/49833/4 "2024-07-09T15:33:03Z")

</div>

thank you for your help

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/system/32/195824_2.png) [@system](https://community.n8n.io/u/system)\
**Post date:** [October 7, 2024, 3:33pm UTC](https://community.n8n.io/t/problem-in-node-mongodb-aggregation/49833/5 "2024-10-07T15:33:56Z")

</div>

Closed on October 7, 2024, 3:33pm UTC

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