关于云函数调运get数据传值的一个问题 能不能穿带有db.command的表达式?

小程序 文章 2021-03-13 15:01 373 0 全屏看文

AI助手支持GPT4.0

关于云函数调运get数据传值的一个问题 能不能穿带有db.command的表达式?A question about cloud function dispatching get data transfer value Can you wear expressions with db.command?

关于云函数调运get数据传值的一个问题 能不能穿带有db.command的表达式?

关于云函数调运get数据传值的一个问题 能不能穿带有db.command的表达式?

例如一个日期区间传值给云函数:

workdate: _.gte(that.data.date).and(_.lte(that.data.date2))

云函数运行成功但是好像数据获取的不对。

A problem about the cloud function to transfer the value of get data db.command What's the expression for? For example, a date range is passed to the cloud function: workdate:_ .gte( that.data.date ).and(_ .lte( that.data.date2 ))The cloud function runs successfully, but it seems that the data acquisition is wrong.

回答:

黑夜白昼:

你的意思是想问:云函数支持 db.command 吗?

Lgh_李国辉13150849294:我想问,能不能在wx.callfunction里的data中直接传递一个带有_.的表达式,因为如果能的话,云函数会简化好多感觉。
Mr.Zhao:

小程序传给云函数吗?不行的

Lgh_李国辉13150849294:嗯,那就只能传俩个值,然后云函数内编写规则吗?感觉这样云函数要好多if else了,通用性减低了
Mr.Zhao:感觉也没用,传两值到云函数里面再拼接
Lgh_李国辉13150849294:嗯,我想直接传一个   data过去,云函数里就直接   where({data:event.data}),现在应该是不行了把,重新构造重新拼接了,我理解的对不对
Mr.Zhao:理解的对不对,需要你自己学验证。你也可以传字符串,然后eval
Lgh_李国辉13150849294:我都要,既要自己验证又要求教大神,嘿嘿。就这个,我试试
跨商通:

不能。

需要在云函数重组query

-EOF-

AI助手支持GPT4.0