Hey all, is there a way to have wildcards in `Asse...
# ask-community
Hey all, is there a way to have wildcards in
? For instance, I have a bunch of objects that have keys like
["grandparent", "parent", "child"]
and I want to select everything under
I tried something like
AssetSelection.keys(["grandparent", "parent", "*"])
AssetSelection.keys(["grandparent", "parent"])
but those failed
Hey Drew, appreciate the response. I don't think I see anything for my use case though. It seems like everything there is pinned on first providing the full key for a specific op, no wildcards
How about:
Copy code
AssetSelection.keys(["grandparent"]) + AssetSelection.keys(["parent"]).downstream()
? The
method will pick up all assets that depend on that asset key and and of those children.
This was assuming that you didn't want `"grandparent"`'s children, too. If all you actually want is a specific asset and all of its downstream, you can use:
AssetSelection.keys(["grandparent"]) .downstream()
Ah, I might not be explaining the situation well. There are no assets with key of just
or parent. Grandparent and parent are key prefixes for the actually assets, all of which are
["grandparent", "parent", "something"]
. So in my case I want to select every asset that has the key prefixes of
["grandparent", "parent"]
Oh, they're prefixes and not assets. That's my fault! Give me a second to give an actual answer then I really should have caught that while I was writing the code snippets.
The source code for AssetSelection showed a few examples. The worst case you can use AssetSelection.all() and filter down the result set of asset keys.