MongoDB Manual 2.6 学习笔记-Getting Started with MongoDB
来源:互联网 发布:聪明人思维方式知乎 编辑:程序博客网 时间:2024/06/08 19:05
连接到mongo
命令行下mongo
选择一个数据库
show dbs//显示数据库名use mydb//切换到该数据库
进入到mongo shell
一个完整的向mongo插入数据,并且进行查询的过程
use mydbj = { name : "mongo" }k = { x : 3 }db.testData.insert( j )db.testData.insert( k )show collections(show tables)db.testData.find(){ "_id" : ObjectId("4c2209f9f3924d31102bd84a"), "name" : "mongo" }{ "_id" : ObjectId("4c2209fef3924d31102bd84b"), "x" : 3 }
使用游标进行循环遍历find返回的结果就是一个游标
var c = db.testData.find()while ( c.hasNext() ) printjson( c.next() ){ "_id" : ObjectId("51a7dc7b2cacf40b79990be6"), "x" : 1 }{ "_id" : ObjectId("51a7dc7b2cacf40b79990be7"), "x" : 2 }{ "_id" : ObjectId("51a7dc7b2cacf40b79990be8"), "x" : 3 }...
db.testData.findOne()db.testData.find().limit(3)
阅读全文
0 0
- MongoDB Manual 2.6 学习笔记-Getting Started with MongoDB
- Getting Started With Node.js and mongoDB
- MongoDB--Getting Started with Java Driver
- Getting Started with MongoDB (Python Edition) || 开始使用MongoDB
- Node.js知识学习之——Node.js and MongoDB – Getting started with MongoJS
- Node.js and MongoDB - Getting started with MongoJS
- 学习Getting Started With TensorFlow
- Emacs学习笔记 hour3 Getting Started with Emacs
- Tensorflow学习笔记一:getting started with tensorflow
- VIM User Manual第一部分Getting Started整理笔记
- python channels笔记--Getting started with channels
- Getting Started with Pipeline 学习Pipeline
- Allan 译 The Little MongoDB Book (Getting Started)
- Getting Started with Smartphone
- Getting Started With JasperReports
- Getting started with OpenCV
- Getting Started with DWR
- Getting Started With JasperReports
- XMPP传输层加密,抓包看不到具体消息
- ztree 回显数据时 不让父节点选中下面所有的子节点
- PostgreSQL 实时高效搜索
- linux常用指令(2)——vi
- httpClient4.2.1连接池 实现post get请求 https请求
- MongoDB Manual 2.6 学习笔记-Getting Started with MongoDB
- 第5次上机内容预测
- Eclipse PHPEclipse 配置
- caffe问题Check failed: registry.count(type) == 1 (0 vs. 1) Unknown layer type: Python
- 微信小程序音频功能开发实(cai)践(keng)
- 对于数组的理解
- 如何设置Linux时间
- 理解自然语言处理中的卷积神经网络
- ViewPager切换动画PageTransformer使用