When running a Mango query that returns a large dataset the following error is returned:
RangeError: Invalid string length.
This error is on line 212 of utils.js and occurs when JSON.stringify() is executed against a large JSON object.
Info
Environment: Node.js (via
Platform: Debian Bullseye
Adapter: leveldb
Server: PouchDB
Reproduce
To reproduce the issue, run the following query against a database that will return a very large JSON result:
let result = await mydb.find({selector: {"field1": "veryCommonValue"}});
Issue
When running a Mango query that returns a large dataset the following error is returned:
RangeError: Invalid string length.
This error is on line 212 of utils.js and occurs when JSON.stringify() is executed against a large JSON object.
Info
Reproduce
To reproduce the issue, run the following query against a database that will return a very large JSON result:
let result = await mydb.find({selector: {"field1": "veryCommonValue"}});