Replies: 1 comment 4 replies
-
hello, can't answer to your question directly, but I believe that the tagging management has been significantly reworked in a recent-ish release (can't find the exact one), so maybe don't take info from several years ago at face value on that matter, as some things may work differently now. |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
I've been researching this rather simple use case, but cannot find the correct answer anywhere yet - what is the correct syntax of filtering objects over API by their tags using 'OR' logic?
My use case is rather simple - need an API call that returns all objects that have either 'foo' or 'bar' or both tags:
As documentation states
&
will work as AND operator for ManytoMany fields such as tags. Nothing is mentioned about OR logic for such fields.In this comment #3038 (comment) it was mentioned that ManyToManyFields should use
&
for OR and,
for AND, but I am not sure if this was implemented since even the documentation states otherwise. And,
doesn't work for me at all. For example the callGET /api/dcim/sites/?tag=foo,bar
treats 'foo,bar' as one string and returns nothing.I am mostly likely missing something really simple here, so any help would be greatly appreciated!
Tested on a local deployment with 3.4.3 and https://demo.netbox.dev/ (v3.4.4)
Thanks
Beta Was this translation helpful? Give feedback.
All reactions