1.非常流行的nosql数据库(基于bson格式,json的扩展) 2.安装,下载(默认端口27017) 启动 mongod --dbpath /data/db 服务器端mongod启动之后默认是监听额的27017的端口,客服端程序mongo 连接服务端 mongo 127.0.0.1:27017- ...
分类:
数据库 时间:
2017-01-22 22:22:59
阅读次数:
250
mongodb1.mongodb与其它nosql数据库的区别我们之前应该接触过redis或者memcached,他们属于key-value数据库,他们运用哈希算法关联起来,能够达到快速的查询目的。而mongodb是一种“文档数据库”,存储类型是以文档为主,该文档类型为(Bson,其实就是json的二 ...
分类:
数据库 时间:
2017-01-15 20:14:29
阅读次数:
234
mongoDB的文档以BSON格式存储,支持二进制的数据类型,当我们把二进制格式的数据直接保存到mongoDB的文档中。但是当文件太大时,例如图片和视频等文件,每个文档的长度是有限的,于是mongoDb会提供了一种处理大文件的规范--GridFS。 GridFS实现原理 在GridFS数据库中,默认 ...
分类:
数据库 时间:
2016-12-26 00:20:10
阅读次数:
353
MongoDB的基本使用 MongoDB特点: 使用BSON存储数据 支持相对丰富的查询操作(相对其他nosql数据库) 支持索引 副本集(支持多个实例/多个服务器运行同个数据库) 分片(数据库水平扩展) 无模式(同个数据文档中的数据可以不一样) 部署简单方便(默认无密码,也带来安全问题) 服务的启 ...
分类:
其他好文 时间:
2016-12-11 03:09:31
阅读次数:
171
MongoDB stores BSON documents, i.e. data records, in collections; the collections in databases. Databases In MongoDB, databases hold collections of do ...
分类:
数据库 时间:
2016-12-08 18:37:58
阅读次数:
234
MongoDB BSON provides support for additional data types than JSON. Drivers provide native support for these data types in host languages and the mongo ...
分类:
数据库 时间:
2016-12-01 03:44:11
阅读次数:
274
JSON can only represent a subset of the types supported by BSON. To preserve type information, MongoDB adds the following extensions to the JSON forma ...
分类:
数据库 时间:
2016-11-30 22:05:47
阅读次数:
293
在golang中可以使用time.Time数据类型来保存mongodb中的ISODate时间。gtypeModelstruct{
uploadDatetime.Time`bson:"uploadDate"`
}
m:=Model{}
iferr:=c.Find(nil).Select({"_id":0,"uploadDate":1}).One(&m);err!=nil{
fmt.Printf("failedtofinddate,error%s\n",err)
os...
分类:
数据库 时间:
2016-11-15 21:13:25
阅读次数:
261
$type操作符是基于BSON类型来检索集合中匹配的数据类型,并返回结果。 MongoDB 中可以使用的类型如下表所示: 参考资料:http://www.runoob.com/mongodb/mongodb-operators-type.html ...
分类:
数据库 时间:
2016-11-08 17:30:05
阅读次数:
209
由于想在mongoose中使用Q,所以将mongoose升级到了4.1.0,而线上mongoDB的版本是2.6.7,升级的时候,node-modules存在mongoose的残渣,所以调用 npm i 的时候,mongoose没有更新完全, 因此线上就报了 BSON.BSONPure is not ...
分类:
其他好文 时间:
2016-10-25 18:39:20
阅读次数:
140