# Firestore Query Issue: Exceeding Maximum Call Stack Size Error

**URL:** <https://community.n8n.io/t/firestore-query-issue-exceeding-maximum-call-stack-size-error/29432>\
**Category:** Questions\
**Tags:** firestore\
**Created:** [August 16, 2023, 1:48pm UTC](https://community.n8n.io/t/firestore-query-issue-exceeding-maximum-call-stack-size-error/29432 "2023-08-16T13:48:47Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![RRonan](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/rronan/32/15762_2.png) [@RRonan](https://community.n8n.io/u/RRonan)\
**Post date:** [August 16, 2023, 1:48pm UTC](https://community.n8n.io/t/firestore-query-issue-exceeding-maximum-call-stack-size-error/29432/1 "2023-08-16T13:48:47Z")

</div>

Hello everyone.  
I’m querying a collection in Firestore to retrieve all documents from a given collection, and until recently, it was returning normally. Recently, I resumed the project and started receiving this message:

ERROR: Maximum call stack size exceeded

However, the number of documents in the collection is small (only three). Other workflows and even other nodes within the same workflow, which handle much more data, run normally. The only thing that was changed were the rules. As a test, I restored the rules to the state when there was no problem, but I still continue to receive the message. Therefore, I deduce that it shouldn’t be the rules, but…

What are the possible issues, and how should I address them?  
What tests could I perform to analyze this?

Thank you.

## Share the output returned by the last node

**RangeError: Maximum call stack size exceeded  
at documentToJson (/usr/local/lib/node\_modules/n8n/node\_modules/n8n-nodes-base/dist/nodes/Google/Firebase/CloudFirestore/GenericFunctions.js:87:60)  
at documentToJson (/usr/local/lib/node\_modules/n8n/node\_modules/n8n-nodes-base/dist/nodes/Google/Firebase/CloudFirestore/GenericFunctions.js:120:27)  
.  
.  
.  
at documentToJson (/usr/local/lib/node\_modules/n8n/node\_modules/n8n-nodes-base/dist/nodes/Google/Firebase/CloudFirestore/GenericFunctions.js:120:27)**

## Information on your n8n setup

- **n8n version: 0.236.3**
- **Running n8n via Docker:**

---

<div class="post-metadata">

**Author:** ![RRonan](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/rronan/32/15762_2.png) [@RRonan](https://community.n8n.io/u/RRonan)\
**Post date:** [August 16, 2023, 2:34pm UTC](https://community.n8n.io/t/firestore-query-issue-exceeding-maximum-call-stack-size-error/29432/3 "2023-08-16T14:34:31Z")

</div>

Firestore Query Test Update: Issue Resolved by Disabling ‘Simplify’ Option – What’s the Logic Behind It?"

---

<div class="post-metadata">

**Author:** ![MutedJam](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/mutedjam/32/70851_2.png) [@MutedJam](https://community.n8n.io/u/MutedJam)\
**Post date:** [August 17, 2023, 10:17am UTC](https://community.n8n.io/t/firestore-query-issue-exceeding-maximum-call-stack-size-error/29432/4 "2023-08-17T10:17:34Z")

</div>

Hi @RRonan, glad to hear this is now working for you. Are you using reference fields by any chance here? I seem to remember these having some potential for trouble. Disabling the “simplify” option would prevent these from being resolved automatically iirc.

---

<div class="post-metadata">

**Author:** ![RRonan](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/rronan/32/15762_2.png) [@RRonan](https://community.n8n.io/u/RRonan)\
**Post date:** [August 17, 2023, 11:48am UTC](https://community.n8n.io/t/firestore-query-issue-exceeding-maximum-call-stack-size-error/29432/5 "2023-08-17T11:48:51Z")

</div>

Yes, there are two reference fields. I tested it by deleting these fields, and the node worked normally. Thank you for the clarification.

---

<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:** [November 15, 2023, 11:49am UTC](https://community.n8n.io/t/firestore-query-issue-exceeding-maximum-call-stack-size-error/29432/6 "2023-11-15T11:49:38Z")

</div>

Closed on November 15, 2023, 11:49am UTC

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