上一页 1 ··· 25 26 27 28 29 30 31 32 33 ··· 35 下一页
摘要: 查询以 李 开头的 db.student.find({name:/^李/}) 查询英文的 姓名 db.student.find({name:/^[a-zA-Z]{2,10}$/}) 分页 // db.student.find({}).limit(2) skip 起始位置 db.student.fin 阅读全文
posted @ 2019-08-26 16:48 EricBlog 阅读(1628) 评论(0) 推荐(0) 编辑
摘要: 查询 db.student.find({}) 查询db.student.find({name:"李强1"}) 查询 条件查询 db.student.find({sex:"male",age:{$gte:20}}) 查询返回一条记录 db.student.findOne({}) 表达式 $lt 小于 阅读全文
posted @ 2019-08-26 14:42 EricBlog 阅读(189) 评论(0) 推荐(0) 编辑
摘要: 切换/创建数据库 use test 添加数据db.student.save({name:"J33ack",age:25}) 查看数据库show dbs 删除当前数据库 db.dropDatabase() 创建集合 db.createCollection("student") 查看集合show col 阅读全文
posted @ 2019-08-26 11:09 EricBlog 阅读(211) 评论(0) 推荐(0) 编辑
摘要: use admindb.createUser({ user:"admin", pwd:"abc123456", roles:[{role:"root",db:"admin"}]}) 开启权限认证 在 C:\Program Files\MongoDB\Server\4.0 目录下新建 mongodb. 阅读全文
posted @ 2019-08-26 09:17 EricBlog 阅读(400) 评论(0) 推荐(0) 编辑
摘要: https://www.mongodb.com/download-center/community 在服务里 可以启动和关闭服务 net stop "mongodb" net start "mongodb server" 配置环境变量 添加到 path 目录 C:\Program Files\Mon 阅读全文
posted @ 2019-08-23 16:45 EricBlog 阅读(93) 评论(0) 推荐(0) 编辑
摘要: from redis_db import poolimport redisimport timecon = redis.Redis( connection_pool=pool)try: # 字符串 # con.set("country", "英国") # con.set("city", "伦敦") 阅读全文
posted @ 2019-08-23 11:05 EricBlog 阅读(181) 评论(0) 推荐(0) 编辑
摘要: https://pypi.org/project/redis/ pip install redis 阅读全文
posted @ 2019-08-22 17:57 EricBlog 阅读(248) 评论(0) 推荐(0) 编辑
摘要: http://doc.redisfans.com/ 阅读全文
posted @ 2019-08-22 16:27 EricBlog 阅读(134) 评论(0) 推荐(0) 编辑
摘要: multi 开启一个事务 set num 0 watch num 监视数据 multi 开启事务 incr num 增加1 incrby num 10 增加10 exec 结束事务 discard 取消事务 阅读全文
posted @ 2019-08-22 16:26 EricBlog 阅读(73) 评论(0) 推荐(0) 编辑
摘要: del 删除记录 del keyword exists 判断是否存在某个key exists employee 存在返回 1 否则返回0 expire 设置记录过期时间 expire employee 5 5秒 expireat : 设置记录的过期时间 时间戳 move 把记录迁移到其他逻辑库 mo 阅读全文
posted @ 2019-08-22 16:02 EricBlog 阅读(133) 评论(0) 推荐(0) 编辑
上一页 1 ··· 25 26 27 28 29 30 31 32 33 ··· 35 下一页