微信云开发使用教程,实现世界排行榜等功能

cocos里就一个调用呀

报什么错 不应该在fail里写增加数据,
应该判断查询结果是否为空,空的时候新增

我不在fail里写增加数据,只要personalInformation集合中没有这个要查询的OPENID值就报错

下面是personalInformation集合中没有这个要查询的OPENID值 包的错,我把fail回掉去了之后的

Error: errCode: -404011 cloud function execution error | errMsg: cloud.callFunction:fail requestID f4b44707-1581-11e9-9e6f-525400e8849e, cloud function service error code -504002, error message errCode: -1 unknown error | errMsg: document.get:fail document with _id “” does not exist; at document.get api; ; at cloud.callFunction api;

我在onload加载的时候init

mark

世界排行榜只能看三个

云开发点了没反应,有人遇到吗

赞,
很详细的教程。

感谢楼主分享,奎特尔星球公众号愿意转载你的教程,不知道是否愿意?

愿意。

没遇到 是新版本吗

适配没做好,有的机型滑不上去

.doc里查询的是自动生成的id的值,数据库插入一条记录,会自动生成一个id和一个openid,用.doc查询的时候只能根据id去查

找到原因了,是后台没有开通云开发,现在按照你的例子加了一条云函数,但是更改游戏代码重新构建后,cloud-functions文件夹被删除了,project.config.json也恢复之前的了,这个过程是每次构建都要重新弄一遍吗,感觉有点麻烦

不用重复这个过程应该也能用,我每次构建都没有重复,消失了没关系,但如果要修改云函数内容的话就要重复

感谢你的分享,已经转发
https://mp.weixin.qq.com/s?__biz=MzA5MjEwOTI4Ng==&mid=2247484526&idx=1&sn=95312dbaf51442171a5f8e818e4f96bf&scene=19#wechat_redirect

ok。

mark,好东西啊,能用的话排行榜不需要自己的后台做了

你好 我在云函数上传部署的时候出现了错误

信息如下:
上传 saveUserData 在等待云端函数代码更新及依赖安装完成阶段失败
Error: 更新云函数失败:Install Dependency Error: install dependency failed: npm ERR! file /data/usercode/1547793881819024609/package.json npm ERR! code EJSONPARSE npm ERR! Failed to parse json npm ERR! Unexpected end of JSON input while parsing near ‘’ npm ERR! File: /data/usercode/1547793881819024609/package.json npm ERR! Failed to parse package.json data. npm ERR! package.json must be actual JSON, not just JavaScript. npm ERR! npm ERR! Tell the package author to fix their package.json file. JSON.parse npm ERR! A complete log of this run can be found in: npm ERR! /data/npm_cache/_logs/2019-01-18T06_44_42_243Z-debug.log

请问你知道是怎么回事吗。。?

还有请问你云函数里的package.json是空的吗。。? 我自己新建了一个空的在那里。代码跟你的是一样的~