敷衍,上面已经说的很明了了,难道需要提供设备给你吗? 具体步骤: 1、我有一个蓝牙设备,已经能连接上了,然后在代码里使用 wx.onBLEConnectionStateChange监听链接状态(代码如上) 2、手机预览代码,连接设备后,手动关闭设备,能正常监听到状态变化 3、手机真机调试,连接设备后,手动关闭设备,无法监听设备被关闭的状态
2022-05-27这个是官方的示例,我也纳闷了,示例里没有5,怎么结果会有5,求解啊
云开发的数据库操作符的setDifference的运算结果有问题{ "_id": 1, "A": [ 1, 2 ], "B": [ 1, 2 ] } { "_id": 2, "A": [ 1, 2 ], "B": [ 2, 1, 2 ] } { "_id": 3, "A": [ 1, 2 ], "B": [ 1, 2, 3 ] } { "_id": 4, "A": [ 1, 2 ], "B": [ 3, 1 ] } { "_id": 5, "A": [ 1, 2 ], "B": [ ] } { "_id": 6, "A": [ 1, 2 ], "B": [ {}, [] ] } { "_id": 7, "A": [ ], "B": [ ] } { "_id": 8, "A": [ ], "B": [ 1 ] } 下面的代码使用 [代码]setDifference[代码],找到只存在于 [代码]B[代码] 中的数字: db.collection('test') .aggregate() .project({ isBOnly: $.setDifference(['$B', '$A']) }) .end() { "_id": 1, "isBOnly": [] } { "_id": 2, "isBOnly": [3] } { "_id": 3, "isBOnly": [3] } { "_id": 4, "isBOnly": [5] } { "_id": 5, "isBOnly": [] } { "_id": 6, "isBOnly": [{}, []] } { "_id": 7, "isBOnly": [] } { "_id": 8, "isBOnly": [1] } 测试结果和官方给出的结果不一样啊 https://developers.weixin.qq.com/miniprogram/dev/wxcloud/reference-sdk-api/database/command/aggregate/AggregateCommand.setDifference.html
2020-12-01