appy-one / acebase

A fast, low memory, transactional, index & query enabled NoSQL database engine and server for node.js and browser with realtime data change notifications
MIT License
481 stars 27 forks source link

Removing a large dataset throws RangeError #231

Open kylerberry opened 1 year ago

kylerberry commented 1 year ago

Hi, I'm working with the local instance of AceBase. I have an an index of Things that has ~100k records in it. Attempting to drop those records to do a fresh data import results in the following error: RangeError: Maximum call stack size exceeded

Example code:

  public _drop() {
    return this.db.ref('Things').remove();
  }
ilkkanisula commented 1 year ago

It would help developer if you can clone this repo and write new failing unit test case with your example. See existing tests in repo for example.

As a workaround I guess you could write loops to iterate your dataset using existing api calls to make smaller remove patches.

Root cause of this error you are seeing is probably a recursion that code uses to walk the database tree.