-
Notifications
You must be signed in to change notification settings - Fork 57
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
Multiple changes to the same file in one run #16
Comments
This is a good idea. I recommend using standard command line args for each key/value rather than comma-delimited, because there's the possibility that commas are a part of the JSON key it's associated value, and we should avoid any additional escaping.
This way the How does this sound? |
Good propasal, @tidwall. What should happen if someone if trying to updates multiple properties via stdin/file and does not supply the values using |
Yeah. I think that should be prohibited. Multiple keys for update/set operations only. Unless we want to accept multiple keys for a get operations and return the values as a JSON array. |
Temporary solution - edit for your requirements:
|
Hey there,
Thank you for an awesome tool! For my use case I need to do multiple small modifications to the same json document and I'd like to do them in one call to the binary.
So for example, instead of:
I'd like to do something like this:
Reasoning is, less child processes (which are costly in node.js, which I am using) and reading in the same json file only once in Go instead of multiple times (https://github.com/tidwall/jj/blob/master/cmd/jj/main.go#L151) and also saving it only once to disk instead of multiple times (https://github.com/tidwall/jj/blob/master/cmd/jj/main.go#L246).
Is this something that you'd consider implementing, or maybe even accepting a PR for it? 😱
The text was updated successfully, but these errors were encountered: