如何在node-orm中检查列的NULL值

mdm*_*mdm 7 javascript database orm node.js

我在node.js中使用orm包,我正在尝试使用find()我的一个模型查询数据库.但是,我无法弄清楚如何使用来检查列的NULL值find().有没有办法做到这一点?

Seb*_*NCA 0

将 null 放入条件中怎么样

\n\n
schema.find({ col: null}, function (err, people) {  \xe2\x80\xa6  });\n
Run Code Online (Sandbox Code Playgroud)\n\n

或者

\n\n
schema.count({ col: null }, function (err, count) {\n    console.log("We have %d Does in our db", count);\n});\n
Run Code Online (Sandbox Code Playgroud)\n\n

文档还说您可以进行原始查询

\n\n
db.driver.execQuery(\n  "SELECT * FROM table WHERE col IS NOT NULL",\n  function (err, data) { ... }\n)\n
Run Code Online (Sandbox Code Playgroud)\n