【已解决】collection.where参数的字段名怎么使用变量?
发布于 4 年前 作者 haoguiying 12404 次浏览 来自 问答
dbcollection'todos'where
  price _lt100get

字段price,能怎样变量代替,试了一些方法都get不到数据

1 回复

var   a = ‘price’

db.collection(‘todos’).where({ [a]: _.lt(100)}).get()

回到顶部