return await db.collection('singleinfo').where({ // role: event.role, //取消推荐角色 sex: event.sex, location: db.RegExp({ regexp: event.location, options: 'i', }) // /event.location/i, }).field({ 不行
云函数模糊查询,想查询前某字符串前两个字符是某固定的两个字符?else if (event.a == 4) // { try { return await db.collection('singleinfo').where({ sex: event.sex, location: db.RegExp({ regexp: 'event.location$', options: 'i', }) // /event.location/i, }).field({ }).get() } catch (e) { console.log(e) } event.location传值过来是字符串“北京”,数据库里面有location为北京西城或者北京东城的数据,这样写云函数得不到要查询的数据,请教大佬怎么实现模糊查询呢?
2022-08-22可以新增云函数中其他sql语句还成功,就是旧的sql语句,新增参数都没有更新效果。
更新了云函数参数,上传云函数失败,感觉一直都是用的是老函数?Error: TencentCloud API error: { "Response": { "Error": { "Code": "FailedOperation.UpdateFunctionCode", "Message": "当前函数处于Updating状态,无法进行此操作,请稍后重试。" }, "RequestId": "ed630a3c-0ff0-4e19-93f3-83eb40888216" } }
2022-08-19<i class="iconfont icon-text_color {{formats.color==='#0000ff' ? 'editor_button_active' : ''}}" data-bind="format" data-name="color" data-value="#0000ff"></i> 这只设置的蓝色,然后蓝色黑色不停切换。
富文本editor编辑器字体颜色设置,请教,怎么弄呢?在wxml中该怎么设置字体颜色的代码呢,***那该写什么代码呢,有例子参考吗? <i class="iconfont icon-text_color" ******></i> <i class="iconfont icon-charutupian" catchtouchend="insertImage"></i>
2022-06-23orderBy('time','desc'). 不能用这个,用这个就会出问题。
aggregate聚合有时有值,有时就是null,时好时坏?const $ = db.command.aggregate else if (event.a == 5) { //使用 try { return await db.collection('chatmsg').aggregate().match({ fromopenId: event.fromopenId, }).orderBy('time','desc').group({ //根据时间降序,取最近100用户数据 _id: { toopenId: '$toopenId', toavatar: '$toavatar', tonickName: '$tonickName', tosex: '$tosex', }, readstate: $.sum('$readstate'), time: $.last('$time'), content: $.last('$content'), }).end() } catch (e) { console.log(e) } }
2022-06-07 totalreadstate: $.sum('$readstate')这样写感觉没问题啊,就是得不到结果。
$.sum统计不对吗,这样写总是得到null,去掉$.sum语句还能有值?return await db.collection('chatmsg').match({ fromopenId: event.toopenId, }).aggregate().group({ _id: { toopenId: '$toopenId', toavatar: '$toavatar', tonickName: '$tonickName', tosex: '$tosex' }, totalreadstate: $.sum('$readstate') }).end()
2022-06-03else if (event.a == 5) { //使用 try { return await db.collection('chatmsg').aggregate().match({ fromopenId: event.toopenId, }).group({_id:'$toopenId'}).end() } catch (e) { console.log(e) } }
云函数对某个字段相同的那条记录去重,distinct怎么使用呢?else if (event.a == 5) { //使用 try { return await db.collection('chatmsg').where({ toopenId: event.toopenId, }).orderBy('time','desc').distinct('fromopenId').get() } catch (e) { console.log(e) } }
2022-06-01这个name名字还是一个常量用,而不是作为“123”,如果name变量改成234,其实他们都是同一个name的存储空间里面。
wx.getStorageSync(chatmsgname),chatmsgname可以为一个变量?wx.getStorageSync(chatmsgname),想chatmsgname为一个变量,“chatmsgname”,这样也不行,而是一个常量。
2022-05-26调用云函数也只能获取100条,在很多情况下就不方便。 解决这个问题的话首先说原理: 1、获取总数,获取所想要调用数据的总数,count。
云函数每次只能最多获取100条数据吗?我用云函数查询云数据库数据,一次最多100条数据吗?
2022-05-24小程序 text文本组件
文件内容换行问题,有时发布的内容,段落层次按理说分明,怎么实现呢?可是现在实现的是文件没有空格,也没有分段,就是一堆文字连在一起。
2022-04-26 position: fixed;
怎么让下面圆形按钮在上面图片中显示,请教,怎么处理?<image src="{{xinghe}}" class="slide-image"> </image> //上面是图片,下面是按钮 <view animation="{{animation}}" class="circle" style="margin-left: 38%;"> <view class="positionNumber"> <view>进入</view> <view style="color:white">单身广场</view> </view> <view class="wave"></view> </view>
2022-04-19