本文介绍了字段为空的环回的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何查询一个为空的字段?我收到一个SQL错误
filter = [where] [category_id] [eq] [null]导致
SELECT WHERE category_id'null' ORDER BY id
使用最新版本的环回和loopback-connector-mysql
解决方案
您可以像
SELECT WHERE category_id'null' ORDER BY id
一样使用filter
/model?filter[where][category_id][eq]=null
如环回所示
/medias?filter[where][keywords][inq]=foo&filter[where][keywords][inq]=bar
参考链接:此处
How can I query a field which is null? I get a a sql error
filter=[where][category_id][eq][null] results in
SELECT WHERE category_id'null' ORDER BY id
using latest version of loopback and loopback-connector-mysql
解决方案
You can use filter
like
/model?filter[where][category_id][eq]=null
As you see in loopback
/medias?filter[where][keywords][inq]=foo&filter[where][keywords][inq]=bar
reference link : here
这篇关于字段为空的环回的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!