Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sailsjs find where field is not set

I have a project in SailsJs, using waterline with a mongodb database. I have some fields defined, which are not required fields. I need to search records where that field is not defined. For example:

{id: 10, name: "jj"}
{id: 11, name: "kk", surname: "sr"}

I want to search where surname is not defined. Anybody has a clue how to do this?

I have tried

{surname: null}
{surname: ''}

Nothing produces the desired result.

like image 932
yBrodsky Avatar asked Jan 22 '26 05:01

yBrodsky


1 Answers

I think what you want is Model.find( {where: {surname: null } }) Check out this link to Waterline Query language documentation

like image 75
Brad W Avatar answered Jan 25 '26 06:01

Brad W



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!