This commit is contained in:
Víctor Losada Hernández
2026-11-03 19:23:51 +01:00
parent 798f14feba
commit 2eead59e78
+7 -7
View File
@@ -29,26 +29,26 @@ const rendererConditions = (legacy, v3)=>{
return {}; // If all renderers selected, renderer field not needed in query for speed return {}; // If all renderers selected, renderer field not needed in query for speed
}; };
const tagConditions = (tagsAnd, tagsOr, tagsNot) => { const tagConditions = (tagsAnd, tagsOr, tagsNot)=>{
const conditions = {}; const conditions = {};
if (tagsAnd.length > 0) { if(tagsAnd.length > 0) {
conditions.tags = { conditions.tags = {
$all: tagsAnd.map(tag => tag.trim()) $all : tagsAnd.map((tag)=>tag.trim())
}; };
} }
if (tagsOr.length > 0) { if(tagsOr.length > 0) {
conditions.tags = { conditions.tags = {
...conditions.tags, ...conditions.tags,
$in: tagsOr.map(tag => tag.trim()) $in : tagsOr.map((tag)=>tag.trim())
}; };
} }
if (tagsNot.length > 0) { if(tagsNot.length > 0) {
conditions.tags = { conditions.tags = {
...conditions.tags, ...conditions.tags,
$nin: tagsNot.map(tag => tag.trim()) $nin : tagsNot.map((tag)=>tag.trim())
}; };
} }