// Match either condition
await products.query({
filter: {
$should: [{ category: "electronics" }, { category: "sports" }],
},
});
// Optional boost: "wireless" is required, "premium" boosts score if present
await products.query({
filter: {
$must: {
name: "wireless",
},
$should: {
description: "premium",
},
},
});
// Multiple optional boosters
await products.query({
filter: {
$must: {
category: "electronics",
},
$should: [
{ name: "wireless" },
{ description: "bluetooth" },
{ description: "premium" },
],
},
});