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

Feature request: recs decollate #81

Open
tzenes opened this issue Mar 21, 2019 · 2 comments
Open

Feature request: recs decollate #81

tzenes opened this issue Mar 21, 2019 · 2 comments

Comments

@tzenes
Copy link

tzenes commented Mar 21, 2019

Right now when I use recs decollate it dumps the original object into my new records

% echo '{"field":[{"test":5},{"test":6}]}' | recs decollate -d unarray,field,temp
{"temp":{"test":5},"field":[{"test":5},{"test":6}]}
{"temp":{"test":6},"field":[{"test":5},{"test":6}]}

I can clean this up on my own:

% echo '{"field":[{"test":5},{"test":6}]}' | recs decollate -d unarray,field,temp | recs xform '$r={{temp}}'
{"test":5}
{"test":6}

But it'd be nice to not have to (since there is presumably wasted work)

@benbernard
Copy link
Owner

Mentioned on irc, one way to do this is like so:

% echo '{"field":[{"test":5},{"test":6}]}' | recs xform '$r = {{field}}'
{"test":5}
{"test":6}

Though I agree that it would be nice for decollate to have an option to not include the original values

@tzenes
Copy link
Author

tzenes commented Mar 21, 2019

I hadn't realized xform was clever like that, thank you!

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