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

Is it possible to reduce the fieldmask to some path depth? #1518

Open
nickolation opened this issue Feb 3, 2023 · 1 comment
Open

Is it possible to reduce the fieldmask to some path depth? #1518

nickolation opened this issue Feb 3, 2023 · 1 comment

Comments

@nickolation
Copy link

nickolation commented Feb 3, 2023

For example, I have a fieldmask with paths = {a.b.c, a.b, a.x.d, a.g.f}
I want to transform all paths containing more than 3 nodes so that only the first 2 nodes remain in them. Then remove the matches.
In result i want {a.b, a.x, a.g}
Is there an opportunity to do something like this?

@nickolation nickolation changed the title Is it possible to reduce the mask to some path depth? Is it possible to reduce the fieldmask to some path depth? Feb 3, 2023
@stapelberg
Copy link

This question sounds like an XY problem: http://mywiki.wooledge.org/XyProblem

Can you supply an example program that illustrates as much as possible what you’re trying to do?

The way your question is currently worded, I could say “sure, just remove everything after the first 2 dots”. I’m not sure if the problem you’re facing is that the number of dots is variable, or something else entirely…?

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