for example..
class Page(Document)
tags = ListField(StringField())
In this case, we can find out a value in the tags list like this.
Page.objects(tags='coding')
if tags are like [‘coding’, ‘x’, ‘y’], then the document will be matched…
but My question is how I can find out the value not in the listfield.
my incorrect code would be..
Page.objects(tags!='coding')
or
Page.objects(tags__not = 'coding')
or
Page.objects(tags__not__in = 'coding')
but.. they don’t simply work..
how can I query a document that does not have a given value in a ListField?
To find any pages that don’t have the tags coding use the $nin operator: