Skip to content
This repository has been archived by the owner on Aug 13, 2021. It is now read-only.

fix for empty NOT IN () in WHERE clause #12

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mikemorreale
Copy link

The following code gives an error for trying to do an empty NOT IN (), which is invalid SQL.

var list = [];
User.find().where({id: {not: list}}).exec(function (err, users) {
});

I added a small fix to use WHERE TRUE instead when this occurs.

@mikermcneil
Copy link
Member

@mikemorreale Thank you- we're working on setting up a basic test suite for this module-- would you be interested in getting involved?

@mikemorreale
Copy link
Author

Sure, I'd be happy to help out.

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

Successfully merging this pull request may close these issues.

2 participants