Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

$nin operator seems like fail with empty array #42

Open
micskeil opened this issue Sep 20, 2021 · 0 comments
Open

$nin operator seems like fail with empty array #42

micskeil opened this issue Sep 20, 2021 · 0 comments

Comments

@micskeil
Copy link

const exclude = loadedItems.map(item => item._id);

The following query doesn't work (gives back zero elements) when the exlude is an empty array. Tested many different ways.

const query = searchValue ? {
parentId: { $eq: selectedFolderId },
_id: { $nin: exclude },
name: { $regex: searchValue, $options: "i" },
} : {
parentId: { $eq: selectedFolderId },
_id: { $nin: exclude },
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant