MongoDB
Yweir
这个作者很懒,什么都没留下…
展开
-
MongoDB 访问控制
添加管理员打开终端,连接mongomongosh --port 27017创建用户管理员use admindb.createUser( { user: "admin", pwd: "admin", roles: [ { role: "userAdminAnyDatabase", db: "admin" }, { role: "readWriteAnyDatabase", db: "admin" } ] })退出MongoDB原创 2021-10-16 14:12:47 · 447 阅读 · 0 评论 -
centos7 mongodb 搭建教程
配置 yum 源vim /etc/yum.repos.d/mongodb-org-5.0.repo[mongodb-org-5.0]name=MongoDB Repositorybaseurl=https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/5.0/x86_64/gpgcheck=1enabled=1gpgkey=https://www.mongodb.org/static/pgp/server-5.0.asc下载原创 2021-10-16 11:53:04 · 244 阅读 · 2 评论 -
MongoDB 格式化时间
语法db.COLLECTION_NAME.aggregate(AGGREGATE_OPERATION)实例集合中的数据如下// 1{ "_id": ObjectId("60f0d9913e2e8152fb6c3aa0"), "identificationType": NumberInt("1"), "byThermometryUnit": NumberInt("0"), "byIsAbnomalTemperature": NumberInt("0"), "原创 2021-08-09 09:46:42 · 4011 阅读 · 0 评论 -
MongoDB 多表级联查询
MongoDB 多表级联查询设置级联表格LookupOperation lookup = Aggregation.lookup("关联表", "主表字段", "关联表字段", "关联表别名");设置查询数据AggregationOperation match = Aggregation.match(Criteria.where("判断字段").is("判断值"));设置分页信息//设置查询字段长度LimitOperation limit = Aggregation.limit(获取数据大小原创 2020-09-17 18:35:44 · 1865 阅读 · 0 评论