目前,我正在使用postgres,访问它通过一个节点服务器。
我卡住的感觉如何,我要搜索一个特定的期限内表,以便作出改变。 我知道我可以选择的某些项目,但是我不知道如何搜索内的项目。
说我的表是:
动物 | 可爱的 | 可怕的 |
---|---|---|
媒体的狗 | 是的 | 没有 |
小狗 | 是的 | 没有 |
毛茸茸的狗 | 是的 | 没有 |
大狗 | 是的 | 是的 |
大型猫科动物 | 没有 | 是的 |
小鱼 | 没有 | 没有 |
突然间,我得到一点狗,现在我想改变一切的含的'狗|狗'可怕的:是的。
我真的不能找到任何好处的资源创造的功能。 也许我们忽略的东西。
现在我使用的是简单的选择是这样的:
app.get('/update/:type', (req, res) => {
pool.query("SELECT animal FROM petlist WHERE scary = 'no' AND animal = $1",[req.params.client],
(error, results) => {
if (error) {
console.log("I selected dog, but I can't see the specific types of dog!")
throw error
}
console.log(results.rows);
res.status(200).json(results.rows)
})
});