Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions server/core/src/fulltext.ts
Original file line number Diff line number Diff line change
Expand Up @@ -290,9 +290,7 @@ function getResultIds (ids: Set<Ref<Doc>>, _id: ObjQueryType<Ref<Doc>> | undefin
const result = new Set<Ref<Doc>>()
if (_id !== undefined) {
if (typeof _id === 'string') {
if (!ids.has(_id)) {
return new Set()
} else {
if (ids.has(_id)) {
result.add(_id)
}
} else if (_id.$in !== undefined) {
Expand All @@ -302,11 +300,13 @@ function getResultIds (ids: Set<Ref<Doc>>, _id: ObjQueryType<Ref<Doc>> | undefin
}
}
} else if (_id.$nin !== undefined) {
for (const id of ids) {
if (!_id.$nin.includes(id)) {
result.add(id)
}
for (const id of _id.$nin) {
ids.delete(id)
}
return ids
} else if (_id.$ne !== undefined) {
ids.delete(_id.$ne)
return ids
}
} else {
return ids
Expand Down