摘要: const MongoClient = require('mongodb').MongoClient; const ObjectId = require('mongodb').ObjectId; const url = "mongodb://localhost:27017"; const dbNam 阅读全文
posted @ 2020-11-03 17:16 wing1377 阅读(192) 评论(0) 推荐(0) 编辑
摘要: const MongoClient = require('mongodb').MongoClient; const ObjectId = require('mongodb').ObjectId; const url = "mongodb://localhost:27017"; // 创建数据库与集合 阅读全文
posted @ 2020-11-03 15:56 wing1377 阅读(73) 评论(0) 推荐(0) 编辑
摘要: MongoDB 一个数据库对应多个集合 一个集合对应多个文档对象 在mongo中不论是db还是集合,你都无需去创建他 直接就当他已经存在,直接Use来使用 use db名称; 接着会被切换到该db中 db.要创建的集合名称.save({});这样集合就被创建了 解决32位异常 mongod --db 阅读全文
posted @ 2020-11-03 07:59 wing1377 阅读(54) 评论(0) 推荐(0) 编辑