随笔分类 -  MongoDB

摘要:// JavaScript source code db.runCommand({ mapreduce: "page", map: function Map() { emit( this.title, // how to group { name: this.name } // associated da... 阅读全文
posted @ 2017-02-16 10:56 iDEAAM 阅读(313) 评论(0) 推荐(0) 编辑
摘要:其中 /fieldFile d:\\fieldFile.txt 是要导出的字段。 fieldFile.txt的内容如下: 阅读全文
posted @ 2017-01-18 16:53 iDEAAM 阅读(1241) 评论(0) 推荐(0) 编辑
摘要:在Heyzap 和 Bugsnag 我已经使用MongoDB超过一年了,我发现它是一个非常强大的数据库。和其他的数据库一样,它有一些缺陷,但是这里有一些东西我希望有人可以早一点告诉我的。 即使建立索引选择性计数还是很缓慢 举个例子,当对用户feed进行分页时,你可能会看到类似的东西, 在MongoD 阅读全文
posted @ 2017-01-17 14:46 iDEAAM 阅读(1613) 评论(0) 推荐(0) 编辑
摘要:索引类型 虽然MongoDB的索引在存储结构上都是一样的,但是根据不同的应用层需求,还是分成了唯一索引(unique)、稀疏索引(sparse)、多值索引(multikey)等几种类型。 唯一索引 唯一索引在创建时加上unique:true 的选项即可,创建命令如下: 上面的唯一索引创建后,如果in 阅读全文
posted @ 2017-01-13 16:52 iDEAAM 阅读(181) 评论(0) 推荐(0) 编辑
摘要:db.User.find().forEach( function(item){ db.User.update({"_id":item._id},{"$set":{"LastUpdate":item.CreateAt}},false,true) } ) 阅读全文
posted @ 2017-01-11 14:45 iDEAAM 阅读(7895) 评论(0) 推荐(0) 编辑
摘要:Sum 按照条件求和 Where条件 阅读全文
posted @ 2016-12-29 18:09 iDEAAM 阅读(8793) 评论(0) 推荐(0) 编辑
摘要:单台机器做sharding 多台机器做sharding & ReplacaSet http://blog.csdn.net/luonanqin/article/details/8497860 --备份 mongodump -h localhost:27020 -d ssr2016db -o G:\M 阅读全文
posted @ 2016-04-18 16:54 iDEAAM 阅读(382) 评论(0) 推荐(0) 编辑
摘要:1.下载rockmongo 下载地址: http://rockmongo.com/downloads 将下载下来的压缩包rockmongo-1.1.5.zip解压到web 发布目录(我这里使用的是apache,发布目录可以参考httpd.conf中的DocumentRoot项) 2.下载mongod 阅读全文
posted @ 2016-03-22 18:07 iDEAAM 阅读(963) 评论(0) 推荐(0) 编辑
摘要:db.collection.createIndex( { a: 1 }, { background: true } )https://docs.mongodb.org/manual/tutorial/build-indexes-in-the-background/ 阅读全文
posted @ 2016-03-11 14:19 iDEAAM 阅读(1472) 评论(0) 推荐(0) 编辑
摘要:1.MongoVUE导出数据正常连接如数据后,打开对应数据库的collections,然后点击右上角的“Refresh”的下拉小三角,打开export根据个人喜好,或业务需求,选择导出的格式最后选择将文件导入到什么地方“粘贴板”数据库实例“外部文件”2.mongVUE数据库性能分析 阅读全文
posted @ 2015-05-07 19:33 iDEAAM 阅读(2002) 评论(0) 推荐(0) 编辑
摘要:随着版本的更新,对在使用mongodb的业务也进行了版本升级,但是在drop掉一个数据库时,问题来了,原来的用户随着删除库也被删除掉,但是再想通过原来的语法db.addUser()添加,一直报错,提示用db.createUser()命令创建。首先如果在除admin库之外的用户通过db.addUser... 阅读全文
posted @ 2015-04-11 16:32 iDEAAM 阅读(281) 评论(0) 推荐(0) 编辑
摘要:Create a file called mongod.cfg in MongoDB folder if you dont have it. In my case: C:\Users\ivanbtrujillo\MongoDBThen, edit mongod.cfg with notepad an... 阅读全文
posted @ 2015-04-11 16:02 iDEAAM 阅读(3622) 评论(0) 推荐(0) 编辑
摘要:方案1. (被否定)加上Redis,做到MongoDB的读写分离,单一进程从MongoDB及时把任务同步到Redis中。看起来很完美,但是上线后出现了各种各样的问题,列举一下:1.Redis队列长度为多少合适?2.同步进程根据优先级从MongoDB向Redis同步过程中,一次取多少任务合适?太大导致... 阅读全文
posted @ 2015-04-06 11:20 iDEAAM 阅读(2148) 评论(0) 推荐(0) 编辑
摘要:网上关于三种集群方式的搭建方式很多,都是分开来介绍的。Replica Set (复制集成)主要是做主从库的,但是没法实现负载均衡的效果,真正实现这个的,是Sharding(分片集群),通过数据分布在每个分片上而实现。所以,如果只用分片,如果一个只有一个主库,那么挂了就真的挂了。所以在我尝试的集群部署... 阅读全文
posted @ 2015-04-05 20:50 iDEAAM 阅读(510) 评论(0) 推荐(0) 编辑
摘要:SQL to MongoDB Mapping ChartIn addition to the charts that follow, you might want to consider theFrequently Asked Questionssection for a selection of ... 阅读全文
posted @ 2015-04-03 15:52 iDEAAM 阅读(494) 评论(0) 推荐(0) 编辑
摘要:MongoDBdidn’t provides any command to create “database“. Actually, you don’t need to create it manually, because, MangoDB will create it on the fly, d... 阅读全文
posted @ 2015-04-03 15:51 iDEAAM 阅读(779) 评论(0) 推荐(0) 编辑
摘要:1. 先引用以下Dll(如果找不到 到gethub上下载源代码自己编译 特别是MongoDB.Driver.Legacy.dll 我自己找了半天没找到):MongoDB.Bson.dllMongoDB.Driver.Core.dllMongoDB.Driver.dllMongoDB.Driver.L... 阅读全文
posted @ 2015-04-03 15:13 iDEAAM 阅读(693) 评论(0) 推荐(0) 编辑
摘要:一,下载 1.官网为:http://www.mongodb.org/ ;下载安装程序的地址为:http://www.mongodb.org/downloads ,选择选择的是Windows 32-bit 2.4.0版本。 2.下载MongoDB For .net 驱动开发包,官方的c#driver位 阅读全文
posted @ 2015-04-03 14:06 iDEAAM 阅读(3072) 评论(0) 推荐(0) 编辑
摘要:120down voteacceptedI would say, it depends on kind of dev team you are and your application needs.For example if there are morequeryingrequired, it m... 阅读全文
posted @ 2015-04-03 10:25 iDEAAM 阅读(312) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示