草庐IT

channel_name

全部标签

python-2.7 - PUBSUB CHANNELS 返回空列表

我有一个python程序如下importjsonimportthreadingimportredisCHANNELS_PREFIX='client'classListener(threading.Thread):STOP=1CONTINUE=0def__init__(self,r):threading.Thread.__init__(self)self.redis=rself.pubsub=self.redis.pubsub()self.pubsub.psubscribe(["%s:*"%CHANNELS_PREFIX])defreload(self,data):print"Reloa

node.js - node.js 和 redis 中的私有(private) channel 。如何?

我写了一个简单的脚本(app.js)来订阅redis的channelvarapp=require('express').createServer(),io=require('socket.io').listen(app);varredis=require("redis");app.listen(8080);//////////////Devenvironment;replacebyPERLinproductionuse.app.get('/',function(req,res){res.sendfile(__dirname+'/index.html');});/////////////

node.js - 在 node.js 中监听 channel redis

有这么简单的代码窃听萝卜channel。redisClient=redis.createClient();redisDummyPublishClient=redis.createClient();//redisClient.auth("25c9721b4e579fc5af961f944e23f46f");//lookforconnectionerrorsandlogredisClient.on("error",function(err){console.log("errorevent-"+redisClient.host+":"+redisClient.port+"-"+err);})

node.js - 多 channel 取决于路径与nodejs和redis

我尝试根据同一端口中nodejs的路径创建多channel。例如(我的端口是8080):www.exemple.com:8080/channel/1www.exemple.com:8080/channel/2www.exemple.com:8080/channel/3www.exemple.com:8080/channel/4每个url路径channel对应一个channelredis例如(channel-X):varchannel='channel-X'getRedis.subscribe(channel);但我不知道如何链接channel并重复网址。这是我到当前时间的代码。sock

当我使用 db.<collection_name>.count() 时,MongoDB 报告为零

我很确定我的问题是我中断了查询,我只是不知道如何恢复。尽管当我使用db..count()时我可以看到我的数据库超过了60GB我得到0。我退出了。我试过db.repairDatabase().db.stats()一切都为零。db.getMongo()显示与本地主机的连接。我希望在使用db..count()时得到一个非零值.所以现在我不知道下一步该怎么做,请帮忙。 最佳答案 如果您使用的是WiredTiger存储引擎,当数据库没有完全关闭时,可能会出现不准确的计数结果。在AccuracyafterUnexpectedShutdown:A

node.js - 蒙哥错误: database names cannot contain the character ' ' when using mongoosejs connect to mLab

这是我的JS代码:varmongoose=require('mongoose');mongoose.connect("mongodb://myUsername:myPassword@ds161039.mlab.com:61039/accounttest");这是我启动服务器时的错误C:\Users\QkLahpita\Desktop\server_node_2\node_modules\mongodb\lib\db.js:1774if(databaseName.indexOf(invalidChars[i])!=-1)throwMongoError.create({message:"d

python - 错误是 : No module named django_mongodb_engine. base

我像这样安装并配置了Django/MongoDB!pipinstallvirtualenvsourcemyproject/bin/activatepipinstallhg+https://bitbucket.org/wkornewald/django-nonrelpipinstallhg+https://bitbucket.org/wkornewald/djangotoolboxpipinstallgit+https://github.com/django-nonrel/mongodb-engine所有这些操作都成功了!现在,当我像这样更改settings.py文件时:DATABASE

mongodb - 子文档的 Mongo 更新

我似乎在使用MongoDB时遇到了障碍,我想知道是否有任何障碍,而不必修改我的数据库结构。现在我的数据库结构如下:Company={_id:1,properties:[{property_id:1tags:[{tag_id:1tag_value:1000channels:[{channel_id:1channel_name:"test1"},{channel_id:2channel_name:"test2"}]},{tag_id:2tag_value:2500channels:[{channel_id:2channel_name:"test2"},{channel_id:3channe

node.js - 错误 : database names cannot contain the character '.'

我正在使用meteor.js,我只是去更改.html文件中的一些HTML输出,它开始给我错误:Error:databasenamescannotcontainthecharacter'.'我没有改变任何东西,我记得唯一做的事情就是开始一个我使用meteor.js创建的新项目,然后更新了meteor,现在我遇到了这个问题。其余错误详情:Error:databasenamescannotcontainthecharacter'.'W20130828-09:52:22.049(1)?(STDERR)atvalidateDatabaseName(/Users/jumpingcode/.mete

java - MongoDB - getCollection(String name) 和 getCollectionFromString(String collectionName) 之间的区别?

谁能帮我强调getCollection(Stringname)和getCollectionFromString(StringcollectionName)之间的区别,如MongoDBDBJavaapi中所述?publicDBCollectiongetCollectionFromString(StringcollectionName)Returnsacollectionmatchingagivenstring.Parameters:collectionName-thenameofthecollectionReturns:thecollection和publicDBCollectionge