Query can be any kind of query (objects or links). You can even tag objects referenced by tagged objects at once.
See
fcpc tag-by-query tag:name asset+
fcpc tag-by-query tag:link ldapperson "~" ldaphost
fcpc untag-by-query "tag:*" "*"
fcpc tag-by-query "tag:*,tag2:value,tag3:value2" "*"
fcpc untag-by-query tag "*:*"
To use attribute owned as source for unique tag. This will traverse all objects within query, resolves owned attribute and set according tag.
fcpc tag-by-query "tag:uniq={owned}" Asset+
fcpc tag-by-query "tag:value/{links}" Asset+
usage: fcpc tag-by-query [-h] [--tagalso.left TAGALSO.LEFT] [--tagalso.right TAGALSO.RIGHT]
[--tagalso.same TAGALSO.SAME] [--tagalso.sameleft TAGALSO.SAMELEFT]
[--tagalso.sameright TAGALSO.SAMERIGHT] [--tagalso.links TAGALSO.LINKS]
tag query [query ...]
positional arguments:
tag Tag[s] to set, divided by comma. Use "*" at the end to match more tags
query Query or objects to tag
optional arguments:
-h, --help show this help message and exit
--tagalso.left TAGALSO.LEFT
Tag left objects too when tagging links[Defined:fcplib.cmd.tag_by_query] (default: 0)
--tagalso.right TAGALSO.RIGHT
Tag right objects too when tagging links[Defined:fcplib.cmd.tag_by_query] (default: 0)
--tagalso.same TAGALSO.SAME
Tag same objects too when tagging objects (linked by '~is')[Defined:fcplib.cmd.tag_by_query]
(default: 0)
--tagalso.sameleft TAGALSO.SAMELEFT
Tag same objects too when tagging links (left linked by
'~is')[Defined:fcplib.cmd.tag_by_query] (default: 0)
--tagalso.sameright TAGALSO.SAMERIGHT
Tag same objects too when tagging links (right linked by
'~is')[Defined:fcplib.cmd.tag_by_query] (default: 0)
--tagalso.links TAGALSO.LINKS
Tag all links of objects too when tagging objects[Defined:fcplib.cmd.tag_by_query] (default:
0)