随笔 - 547  文章 - 213 评论 - 417 阅读 - 107万

01 2018 档案
Mongo = get size of single document
摘要:Object.bsonsize(db.test.findOne({type:"auto"})) 阅读全文
posted @ 2018-01-31 09:45 今夜太冷 阅读(181) 评论(0) 推荐(0) 编辑
HTTP协议中源端口和目标端口的问题
摘要:【提问】 How is source port for HTTP determined? Is there ever collision in NAT? I know that when a HTTP request is made, packets are sent from a seemingly-random high-numbered port (e.g. 4575) ... 阅读全文
posted @ 2018-01-30 14:15 今夜太冷 阅读(2671) 评论(0) 推荐(0) 编辑
How to duplicate the records in a MongoDB collection
摘要:// Fill out a literal array of collections you want to duplicate the records in. // Iterate over each collection using the forEach method on the array. // For each collection get (find) all the reco... 阅读全文
posted @ 2018-01-26 10:57 今夜太冷 阅读(193) 评论(0) 推荐(0) 编辑
Create root user on MongoDB
摘要:db.createUser( { user: "user", pwd: "pass", roles: [ "root" ] }); use database;db.createUser( { user: "user", pwd: "pass", roles: [ { role: "readWrite", db: "database" }... 阅读全文
posted @ 2018-01-25 16:43 今夜太冷 阅读(194) 评论(0) 推荐(0) 编辑
mongodb最大连接数、最大连接数修改
摘要:mongodb最大连接数是20000。 所以业界流传一段话,千万级以下的用mysql、千万级以上的用mongodb,亿级以上的用hadoop。 查看mongodb最大连接数 mongodb/bin/mongo >db.serviceStatus().connections; current数值+available数值就是当前mongodb最大连接数 修改mongodb最大连接数 在... 阅读全文
posted @ 2018-01-25 16:08 今夜太冷 阅读(6459) 评论(0) 推荐(0) 编辑
如何实现json字符串和 BsonDocument的互相转换
摘要:String to BsonDocument string json = "{ 'foo' : 'bar' }"; MongoDB.Bson.BsonDocument document = MongoDB.Bson.Serialization.BsonSerializer.Deserialize(json); BsonDocument to json string. BsonDocume... 阅读全文
posted @ 2018-01-24 17:06 今夜太冷 阅读(13052) 评论(0) 推荐(3) 编辑
MonoDB的数据准备
摘要:首先是数据的录入,为了分析我们服务器集群的性能,需要准备大量的用户数据,幸运的是mtools提供了mgenerate方法供我们使用。他可以根据一个数据模版向 MongoDB 中插入任意条 json 数据。下面的 json 结构是我们在例子中需要使用的数据模版: { "user": { "name": { "first": {"$choose": ["Liam", "Aubre... 阅读全文
posted @ 2018-01-24 15:34 今夜太冷 阅读(482) 评论(0) 推荐(0) 编辑
Mongo DB Sharding
摘要:Database Sharding is considered to be the horizontal partitioning of a database or the search engine where each partition is called as a Shard. This is a process of compressing the data collections by... 阅读全文
posted @ 2018-01-23 13:40 今夜太冷 阅读(143) 评论(0) 推荐(0) 编辑
Syntax error missing ; before *
摘要:【问题】 I have a header file like so: #pragma once #include "gamestate.h" #include "ExitListener.h" class InitialGameState : public GameState { public: InitialGameState(Ogre::Camera *cam, Ogre::Sce... 阅读全文
posted @ 2018-01-21 19:20 今夜太冷 阅读(911) 评论(0) 推荐(0) 编辑
Log4net PatternLayout 参数
摘要:Log4net PatternLayout 参数 来自: https://logging.apache.org/log4net/log4net-1.2.13/release/sdk/log4net.Layout.PatternLayout.html A flexible layout configurable with pattern string. For a list of all me... 阅读全文
posted @ 2018-01-18 17:33 今夜太冷 阅读(1507) 评论(0) 推荐(0) 编辑
MongoDB server side Javascript 如何直接传入字符串?
摘要:MongoDB server side Javascript的介绍如下: https://docs.mongodb.com/v3.0/core/server-side-javascript/#running-js-files-via-a-mongo-shell-instance-on-the-server 根据文档描述,可以直接传入一个Javascript对象来做查询,比如: db.adminC... 阅读全文
posted @ 2018-01-18 13:41 今夜太冷 阅读(239) 评论(0) 推荐(0) 编辑
Multiple Instance .NET Windows Service
摘要:It's not readily apparent how to install a Windows Service multiple times on a single machine. At first glance, it seems like it's not supported by th 阅读全文
posted @ 2018-01-17 10:19 今夜太冷 阅读(273) 评论(0) 推荐(0) 编辑
MFC自定义控件如何向父窗口发送自定义消息
摘要:自定义了一个控件 class CHtmlEditCtrlEx : public CHtmlEditCtrl 想在这个控件接收到Ctrl+V键盘消息的时候,向该控件所在的窗口发送一个自定义消息。具体实现方法如下: 在该控件的PreTranslateMessage方法中定义自定义消息,然后将该消息发送给父窗口 BOOL CHtmlEditCtrlEx::PreTranslateMessage(MSG... 阅读全文
posted @ 2018-01-14 09:13 今夜太冷 阅读(1584) 评论(0) 推荐(0) 编辑
Node.js中针对中文的查找和替换无效的解决方法
摘要:Node.js中针对中文的查找和替换无效的解决方法。 //tags的值: tag,测试,帖子 var pos1 = tags.indexOf("测"); //这里返回-1 tags = tags.replace(/,/g, ","); //这里的全角逗号没有被替换成半角逗号 怎么回事那? 【解决方法】... 阅读全文
posted @ 2018-01-09 14:43 今夜太冷 阅读(304) 评论(0) 推荐(0) 编辑
用来创建压缩纹理的工具
摘要:Once a texture has been loaded as a compressed texture, it can be used for texturing in exactly the same way as an uncompressed texture. The details of the ETC2/EAC formats are beyond our scope here... 阅读全文
posted @ 2018-01-08 14:39 今夜太冷 阅读(446) 评论(0) 推荐(0) 编辑
IIS 7.5: HOW TO ENABLE TLS 1.1 AND TLS 1.2
摘要:In IIS 7.5, which is installed on Windows 2008 R2 servers, only SSL 3.0 and TLS 1.0 are enabled for HTTPS encryption by default. To enable TLS 1.1 and TLS 1.2 and disable the insecure SSL 3.0 protocol... 阅读全文
posted @ 2018-01-03 17:30 今夜太冷 阅读(426) 评论(0) 推荐(0) 编辑

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