![](https://img-blog.csdnimg.cn/20201014180756922.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
MongoDB
文章平均质量分 61
mongodb学习记录
AF2DBA
这个作者很懒,什么都没留下…
展开
-
Mongodb常用简单操作
#切换数据库use mongodb;#同时创建数据库mongodb,和表temp_testdb.createCollection('temp_test');#创建唯一索引,哈希类型db.getCollection("temp_test").createIndex({ user_phone: "hashed"},{unique: true,background: true, sparse: true });#创建普通索引db.getCollection("temp_test").createIn原创 2021-04-20 10:46:42 · 208 阅读 · 0 评论 -
Mongodb ObjectId 时间范围查询
ObjectId组成:4字节:UNIX时间戳3字节:表示运行MongoDB的机器2字节:表示生成此_id的进程3字节:由一个随机数开始的计数器生成的值指定时间生成一个ObjectId:mongo > new_time = new ISODate('2021-01-01 00:00:00');mongo > new_objectid = Math.floor(new_time.getTime() / 1000).toString(16) + "00000...原创 2021-04-19 14:54:00 · 1508 阅读 · 0 评论 -
Mongodb4.0分片集群(Centos7)
环境centos7.4 mongodb-4.0.22配置说明 Shard config mongos 192.168.56.1 27017 27018 27019 192.168.56.2 27017 27018 192.168.56.3 27017 27018 192.168.56.4 27017 安装过程 Shard(27017) Co...原创 2021-01-15 17:52:53 · 126 阅读 · 0 评论 -
Mongodb与Mysql语法对比
对象对应关系表Mysql MongoDB database database table collection row document column field index index table joins $lookup primary key primary key 语法对比表MySQL MongoDB CREATE TABLE test( id int, name va..原创 2020-11-11 14:27:24 · 147 阅读 · 0 评论