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
Composing JSON with objects #129
Comments
Let me make sure I understand correctly. I might have a quick addition that would give this to you. You would like to build a JSON document and insert another document in the one you are creating. Did I understand correctly? If so, take a look at the newly added Oj::StringWriter. It allows you to build a JSON document one element at a time. I could extend that to add an existing JSON document as a value. Simple addition if the StringWriter works for you. |
Yes something like this would work:
|
Cool, I'll let you know when it is added. Will most likely call it push_json(). Try to get it in in the next day or two if not tonight. |
Yes push_json makes sense. Thanks for your time. |
Try out release 2.5.0. |
I tested release 2.5.1 and it works as expected. I'm going to use it to compose a large json document (about 100MB out of a PG DB) that is currently decoded and re-encoded, I hope for a speed boost. I'll let you know. |
For info I got a huge performance gain over decode/reencode. Thanks a lot. |
Great, glad it helped. |
I am using some PostgreSQL methods to generate some bits of json that I'd like to compose with objects.
Right now I can do something like:
I'd like to do the same, but without decoding and re-encoding the JSON document.
The text was updated successfully, but these errors were encountered: