Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error on loading data in NeDB #540

Open
punkish opened this issue Feb 1, 2018 · 1 comment
Open

error on loading data in NeDB #540

punkish opened this issue Feb 1, 2018 · 1 comment

Comments

@punkish
Copy link

punkish commented Feb 1, 2018

I am trying to load bulk records (about 200K) into NedB. I get the following error

/path/to/node_modules/nedb/lib/persistence.js:195
toPersist += self.afterSerialization(model.serialize(doc)) + '\n';
                                                        
RangeError: Invalid string length
@JamesMGreene
Copy link
Contributor

JamesMGreene commented Feb 1, 2018

Although NeDB does do its updates in append mode, it also does a full datafile rewrite at the end of the initial loading process and during every compaction operation. If your total record size, when represented as a string, exceeds 256MB, then it will fail as Node.js/V8/JS does not support that large of a string.

See PR #463 for one proposed change that might fix this for you.

I've been working on resolving this in my fork, NestDB, (see JamesMGreene/nestdb#6) but my work is currently stalled out due to lack of free time and a temporary deprioritization of my related at-work project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants