会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
江山一族
博客园
首页
新随笔
联系
订阅
管理
上一页
1
···
8
9
10
11
12
13
14
15
16
···
25
下一页
2018年6月15日
Iview-datePicker获取选中的日期,如果没有选,提示错误,选了,错误隐藏
摘要: 最近遇到大坑,,最后解决了,直接上代码 npm intall iview main.js中引入 import iView from 'iview'; import 'iview/dist/styles/iview.css' <template> <center> <Row> <Col span="1
阅读全文
posted @ 2018-06-15 16:15 江山一族
阅读(435)
评论(0)
推荐(0)
2018年6月13日
mongoose+koa2 按照_id更新多条数据,删除数组中的字段,然后添加新的字段,$pull和$or结合使用
摘要: await model.photo.update({ _id: { $in: photoIdsParam } }, { $pull: { customerIds: { code: custCode, $or: [{ 'userIds.0': { $exists: false } }, { 'user
阅读全文
posted @ 2018-06-13 09:38 江山一族
阅读(1395)
评论(0)
推荐(0)
2018年6月12日
json数组去除重复的值
摘要: 给数组去除重复值 Array.prototype.distinct = function() { var arr = this, result = [], i, j, len = arr.length; for (i = 0; i < len; i++) { for (j = i + 1; j <
阅读全文
posted @ 2018-06-12 23:03 江山一族
阅读(1595)
评论(0)
推荐(0)
mongoose根据_id更新,且如果数组中没有元素就添加
摘要: await model.photo.update({ _id: { $in: photoIdsParam } }, { $addToSet: { customerIds: { code: custCode, isDel: 'true' } } }, { upsert: true })
阅读全文
posted @ 2018-06-12 18:54 江山一族
阅读(464)
评论(0)
推荐(0)
2018年6月11日
在mongoose中使用正则,参数为变量时的写法
摘要: const word = ctx.params.word userModel.find({"name":{$regex: eval(`/${word}/ig`)}}) 如果mongodb或者node版本低了,上面写法很可能不管用,可以采用下面两种写法 title:eval("/"+title+"/i
阅读全文
posted @ 2018-06-11 23:11 江山一族
阅读(1463)
评论(0)
推荐(0)
第一本docker书,,持续更新中
摘要: 1.查看应用是否在docker中部署成功 需要确认curl已安装 whereis curl sudo apt-get -y install curl curl localhost:8081 如果成功,会打印项目代码 2.没有容器,docker会自动下载 docker run -i -t ubuntu
阅读全文
posted @ 2018-06-11 18:49 江山一族
阅读(318)
评论(0)
推荐(0)
2018年6月9日
CentOs中玩docker
摘要: 1.启动: systemctl start docker.service 2.停止: systemctl stop docker 3.从usts上拉取仓库 编辑文件 vi /etc/docker/daemon.json 若果没有则新建一个 在文件中添加{ "registry-mirros":["ht
阅读全文
posted @ 2018-06-09 16:12 江山一族
阅读(247)
评论(0)
推荐(0)
2018年6月8日
js格式化日期
摘要: Date.prototype.Format = function (fmt) { //author: meizz var o = { "M+": this.getMonth() + 1, //月份 "d+": this.getDate(), //日 "h+": this.getHours(), //
阅读全文
posted @ 2018-06-08 13:47 江山一族
阅读(326)
评论(0)
推荐(0)
2018年6月4日
mongoDB,mongoose,没有数组就添加,如果有了数组,就向数组中添加新元素
摘要: db.getCollection('photos').findOneAndUpdate("5b028e71f32bd5004f905879", //findByIdAndUpdate{ '$push':{ 'orderHistory':{ "userId":"5b10d49320b805a7844a
阅读全文
posted @ 2018-06-04 10:57 江山一族
阅读(1927)
评论(3)
推荐(1)
2018年6月3日
node+express跨域处理
摘要:
阅读全文
posted @ 2018-06-03 22:29 江山一族
阅读(208)
评论(0)
推荐(0)
上一页
1
···
8
9
10
11
12
13
14
15
16
···
25
下一页
公告