Filtering queries by document metadata
dict[str, str | list[str]]
. For example, you could attach the following JSON object as document metadata,
list:
.$eq
, $ne
, $gt
, $gte
, $lt
, $lte
. These operators represent “equals”, “not equals”, “greater than”, “greater than or equal to”, “less than”, and “less than or equal to”, respectively. Here is an example of a few filters,
$in
and $nin
for “in” and “not in” operations.
null
for that document. In other words, $eq
, $gt
, $gte
, $lt
, $lte
will all always evaluate to false
. But, $neq
will always evaluate to true
, because null
is not equal to any string. Be careful to not have any typos in your query attribute name, or you may not match any documents!list:
. For example, you can set list:tags
to be a list of tags for a blog article document.
List of strings can only be used with the operators $in
, $nin
. These operators will execute “set intersection”. Meaning, a in b
is true
if and only if a
and b
have at least one element in common. Here are a few examples,
list:
! If you accidentally query for tags
, then you will not find any results. You must query for list:tags
.$and
, $or
as boolean operators. These boolean operators will take in an array of filters. They can also be used recursively to create a tree of boolean logic.