随笔分类 -  mongoose/mongodb

摘要:需要对 id 进行转换 const mongoose = require('mongoose') var ObjectId = mongoose.Types.ObjectId; await Users.aggregate([ { $match : { "_id":new ObjectId("5asd 阅读全文
posted @ 2020-01-19 18:01 武卡卡 阅读(1686) 评论(0) 推荐(0) 编辑
摘要:一、使用 mongodump 命令备份数据 mongodump -h IP --port 端口 -u 用户名 -p 密码 -d 数据库 -c 表 -o 文件存放路径 参数说明: -h 指明数据库宿主机的IP --port 指明数据库的端口 -u 指明数据库的用户名 -p 指明数据库的密码 -d 指明 阅读全文
posted @ 2019-11-04 16:11 武卡卡 阅读(208) 评论(0) 推荐(0) 编辑
摘要:1,博客表结构 Blog.js var mongoose = require('mongoose') mongoose.connect('mongodb://localhost/test',{ useUnifiedTopology: true , useNewUrlParser: true}); v 阅读全文
posted @ 2019-10-28 13:58 武卡卡 阅读(394) 评论(0) 推荐(1) 编辑
摘要:date:{ type: String, default: () => moment(new Date()).format('YYYY-MM-DD HH:mm:ss'), } date:{ type: String, default: () => moment(new Date()).format( 阅读全文
posted @ 2019-09-19 22:50 武卡卡 阅读(742) 评论(0) 推荐(1) 编辑

喜欢请打赏

扫描二维码打赏

支付宝打赏

点击右上角即可分享
微信分享提示