tiled.client.container.Container.search_deep#

Container.search_deep(*queries, max_depth=None)[source]#

Search all descendants of this Node (at any depth), not just direct children.

Returns a DeepSearchResults mapping, not a Node: it is not chainable via further .search()/.search_deep() calls, because matches at different depths do not share a single parent. To narrow a search, pass several queries; they are combined with logical AND.

Parameters:
*queriesquery objects, e.g. from tiled.queries

At least one is required. All must match.

max_depthint, optional

Only descend this many levels below this Node.

Examples

>>> from tiled.queries import Key
>>> results = tree.search_deep(Key("sample_id") == "abc123")
>>> results[("nested", "images", "sample_042")]

Logical AND of several queries:

>>> tree.search_deep(Key("sample_id") == "abc123", Key("depth") > 1)