会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
小楠木
博客园
首页
新随笔
联系
订阅
管理
上一页
1
2
3
4
5
6
7
8
9
10
···
16
下一页
2019年7月
打开nginx配置的站点报错500
摘要: 打开站点报错500的原因 有很多,这里只说明一点:nginx 的fastcgi.conf配置引起的问题 环境说明 1 站点目录结构 wwwroot website public application …… 2 nginx 站点配置 server { listen 80; server_name t
阅读全文
posted @ 2019-07-10 15:56 H辉
阅读(3636)
评论(0)
推荐(0)
2019年6月
mongodb 分组求最大值
摘要: 先上代码 db.getCollection("playback").aggregate([ {$match:{"game_record_id":{$in:[68,69]}}},{$group:{ _id:"$game_record_id", record_id:{$max:"$record_id"}
阅读全文
posted @ 2019-06-25 11:27 H辉
阅读(2372)
评论(0)
推荐(0)
json_encode不自动转义斜杠“/”的方法
摘要: 默认的情况之下使用 json_encode 对数组进行 json 格式的转换时候会自动的将数据中含有斜杠的字符串进行转义,如图 两种解决办法 其一,正则替换: $a = str_replace("\\/", "/", json_encode($a)); 其二,若 php 版本是 5.4 及以上的话:
阅读全文
posted @ 2019-06-19 20:03 H辉
阅读(5464)
评论(0)
推荐(0)
imagettftext(): Could not read font
摘要: imagettftext(): Could not read font 1 确认FreeType Version ( 2以上版本) 2 确认字体路径,要是绝对路径的 3 确认 php.ini 配置 开启php_gettext.dll
阅读全文
posted @ 2019-06-10 20:05 H辉
阅读(1713)
评论(0)
推荐(0)
数据返回正常 而header头Status=500
摘要: 访问接口数据成功返回,但header头Status Code:500,而调用接口的html用ajax访问一直返回500服务器错误,并且ajax一直走error,走不到success中,错误返回状态是连接错误。 原因:runtime下的日志目录没有写权限 解决办法:改runtime所有文件chmod
阅读全文
posted @ 2019-06-10 12:07 H辉
阅读(1060)
评论(0)
推荐(0)
2019年3月
mongo 根据对象中的某个条件来查询
摘要: 假如A表有如下数据 { "id" : 1, "users_info" : [{"uid" : 10001}, {"uid" : 10002}]} { "id" : 2, "users_info" : [{"uid" : 10001}, {"uid" : 10003}]} 执行语句 db.getCol
阅读全文
posted @ 2019-03-19 18:03 H辉
阅读(2933)
评论(0)
推荐(0)
mongo in和not in查询
摘要: 执行语句 db.getCollection("A表").find( { id:{ $in:[1,2]} } ) 作用:查询A表中id字段等于1和等于2 的记录 改成 id:{ $nin:[1,2]} 就是 查询A表中id字段不等于1和不等于2 的记录
阅读全文
posted @ 2019-03-19 17:41 H辉
阅读(29510)
评论(0)
推荐(1)
mongo 字段重命名
摘要: 执行语句 db.getCollection("A表").updateMany( {}, { $rename: { "A": "A1"} } ) 或者 db.getCollection("A表").update( {}, { $rename: { "A": "A1"} } , {multi: true
阅读全文
posted @ 2019-03-19 17:20 H辉
阅读(1279)
评论(0)
推荐(0)
mongo 让字段自增或自减
摘要: 查询语句 db.getCollection("A表").update( { id: 1 }, { $inc: { pid: 1} } ) 作用:根据条件让A表中的pid字段自增1 查询语句分析 条件:id:1 字段自增:$inc: { pid: 1} $inc: { pid: -1} 这样就可以自减
阅读全文
posted @ 2019-03-19 17:02 H辉
阅读(3001)
评论(0)
推荐(0)
mongo 删除 表中字段
摘要: 查询语句 db.getCollection("A表").update( { } ,{ $unset:{"a":1} } , {multi: true} ) 作用:删除A表中a字段 查询语句分析 条件: 可以不写 更新:$unset:{"a":1} 删除A表中a字段 是否改变多条记录:multi: t
阅读全文
posted @ 2019-03-19 16:45 H辉
阅读(4789)
评论(0)
推荐(0)
上一页
1
2
3
4
5
6
7
8
9
10
···
16
下一页
公告