Sails.js 为什么这个查询有效?
sails.js使用水线,有一个很好的水线 如果我省略了Sails.js 为什么这个查询有效?,sails.js,waterline,Sails.js,Waterline,sails.js使用水线,有一个很好的水线 如果我省略了“id:2”并使用just find()而不是findOne()查询仍然有效,但为什么find()应该返回一个列表,这样我就不能在子查询中只说user.id了 如果我没有收到一条记录,而是一个用户列表,我如何访问Comment.find({userId:user.id}) 实际上,Comment.find({userId:user.id})没有意义,但它不会使查询失败,但与我将 Comment.find({userId: null}) 结
“id:2”
并使用just find()而不是findOne()
查询仍然有效,但为什么find()
应该返回一个列表,这样我就不能在子查询中只说user.id了
如果我没有收到一条记录,而是一个用户列表,我如何访问
Comment.find({userId:user.id})
实际上,Comment.find({userId:user.id})
没有意义,但它不会使查询失败,但与我将
Comment.find({userId: null})
结果是一样的,,
查询将像没有搜索参数/筛选器一样运行
Comment.find({userId: null})