摘要: db.students.insert({name:"张三",school:{name:"清华大学", city:"北京"}, age:19, gpa:3.97}) db.students.insert({name:"李四",school:{name:"北京大学", city:"北京"}, age:20, gpa:3.3}) db.students.insert({name:"王二",school... 阅读全文
posted @ 2018-10-07 18:05 热爱技术的小牛 阅读(146) 评论(0) 推荐(0)
摘要: # 启动mongodb服务 sudo service mongod start # 关闭mongodb服务 sudo service mongod stop #进入mongodb shell mongo # 创建数据库 my_mongodb_01 >use my_mongodb_01 switched to db my_mongodb_01 # 查看数据库: > show dbs ... 阅读全文
posted @ 2018-10-07 17:54 热爱技术的小牛 阅读(175) 评论(0) 推荐(0)
摘要: # 启动mongodb服务 sudo service mongod start # 关闭mongodb服务 sudo service mongod stop #进入mongodb shell mongo # 创建数据库 my_mongodb_01 >use my_mongodb_01 switched to db my_mongodb_01 # 查看数据库: > show dbs ... 阅读全文
posted @ 2018-10-07 17:53 热爱技术的小牛 阅读(165) 评论(0) 推荐(0)
摘要: MongoDb 命令查询所有数据库列表 CODE: > show dbs 如果想查看当前连接在哪个数据库下面,可以直接输入db CODE: > db Admin 想切换到test数据库下面 CODE: > use test switched to db test > db Test 想查看test下有哪些表或者叫c... 阅读全文
posted @ 2018-10-07 12:39 热爱技术的小牛 阅读(114147) 评论(0) 推荐(2)
摘要: # -*- coding:utf-8 -*- my_dict = {} my_list = ["username", "zhangsan"] print [my_list] # [['username', 'zhangsan']] my_dict.update(dict([my_list])) # {'username': 'zhangsan'}print my_dict 阅读全文
posted @ 2018-10-07 11:30 热爱技术的小牛 阅读(1417) 评论(0) 推荐(0)
热爱技术的小牛