Step into MongoDB - 03 - Database & Collection & Document
来源:互联网 发布:ubuntu可以用来做什么 编辑:程序博客网 时间:2024/06/05 14:29
目录
- DataBase Collection与 Document
- DataBase
- 显示所有 DB
- 选择 DB
- 查看当前 DB 名
- 删除当前 DB
- Collection
- 显示所有 collections
- Document
- _id
- DataBase
- DataBase Collection与 Document
摘要
显示所有 DB,选择 DB,查看当前 DB,显示所有 Collection,_id,删除当前 DB
DataBase, Collection与 Document
DataBase
显示所有 DB
show dbs
选择 DB
use <dbName>
查看当前 DB 名
db
此 db 是一个 JavaScript 对象,包含有当前数据库的有关信息。
删除当前 DB
db.dropDatabase()
Collection
显示所有 collections
show collections
Document
_id
每个文档都有一个 _id
。默认类型为 ObjectId
,不同于其它数据库的自动增长的主键,ObjectId
在不同机器上也是唯一的,所以更适合作为分布式数据库。
0 0
- Step into MongoDB - 03 - Database & Collection & Document
- mongodb DataBase与Collection
- Step into MongoDB - 02 - 数据类型
- Step into MongoDB - 09 - 索引
- Step into MongoDB - 11 - MapReduce
- Step into MongoDB - 14 - 分片
- Step into MongoDB - 15 - GridFS
- Step into MongoDB - 01 - 安装与运行
- Step into MongoDB - 04 - 简单查询
- Step into MongoDB - 05 - 插入与删除
- Step into MongoDB - 06 - 更新操作
- Step into MongoDB - 07 - 复杂查询
- Step into MongoDB - 08 - 聚合查询
- Step into MongoDB - 10 - 服务端命令
- Step into MongoDB - 12 - 主从复制
- Step into MongoDB - 13 - 副本集
- Step into MongoDB - 16 - 账号管理
- My First Step Into MongoDB – Installing MongoDB on Ubuntu
- QT 打开文件对话框总结
- 看数据结构写代码(50)伙伴系统
- 查找api函数地址
- POJ1611(并查集)
- HDU4114 Disney's FastPass(floyd+状态压缩DP)旅游问题升级(难)
- Step into MongoDB - 03 - Database & Collection & Document
- 基金都快放假吗,可感受到
- bzoj 3993: [Sdoi2015]星际战争
- 图片随机显示器(C#)
- openstack学习笔记----KVM
- nodejs笔记
- JSP Xxx cannot be resolved to a type
- Ubuntu的复制粘贴操作及常用快捷键
- cocos2d-x项目在eclipse打开空指针问题An internal error occurred during: "Android Library Update". java.lang.Nul