摘要: // 引入mongoose第三方模块 用来操作数据库 const mongoose = require('mongoose'); // 数据库连接 mongoose.connect('mongodb://localhost/playground', { useNewUrlParser: true}) 阅读全文
posted @ 2020-11-02 16:04 铁马冰河入_来 阅读(113) 评论(0) 推荐(0) 编辑
摘要: 1 // 引入mongoose第三方模块 用来操作数据库 2 const mongoose = require('mongoose'); 3 // 数据库连接 4 mongoose.connect('mongodb://localhost/playground', { useUnifiedTopol 阅读全文
posted @ 2020-11-02 15:51 铁马冰河入_来 阅读(125) 评论(0) 推荐(0) 编辑
摘要: 导入json数据到数据库 mongoimport -d playground -c user --file ./user.json 如果导入不成功 ,在电脑环境变量PATH添加MongoDB的路径。 1 // 引入mongoose第三方模块 用来操作数据库 2 const mongoose = re 阅读全文
posted @ 2020-11-02 15:11 铁马冰河入_来 阅读(168) 评论(0) 推荐(0) 编辑