Dealing with a JSON object too big to fit into memory

孤人 提交于 2019-12-06 14:22:01

I went ahead and edited JSONStream to add this functionality.

If anyone runs across this and wants to patch it similarly, you can replace line 83 which was previously

stream.queue(this.value[this.key])

with this:

var ret = {};
ret[this.key] = this.value[this.key];

stream.queue(ret);

In the code sample from the original question, rather than user being equal to { foo: bar } in the callback it will now be { uid: { foo: bar } }

Since this is a breaking change I didn't submit a pull request back to the original project but I did leave it in the issues in case they want to add a flag or option for this in the future.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!