Tag: meteor

与mongodbmeteor采集中的重复密钥

我目前正在开发一个meteor应用程序,有时我的服务器出现这个错误: 调用方法'/ songs / insert'时出现exceptionMongoError:E11000重复键错误索引:megan.songs。$ id dup键:{:“399dc507-b1fe-4e0f-a2c4-fa3dabd2bdf5”} 插入方法是这样调用的: Songs.insert({name:vid,score:weight,title:title,listkey:Session.get('listkey')}); 有谁能够帮助我? 提前致谢, Topicus

与meteor.js分发cocoa应用程序

有谁知道是否有可能(如果是这样,如何)分发与meteor.js的cocoa应用程序,并通过networking视图呈现? 我的意思是我想启动一个meteor服务器(或node.js)insied我的cocoa应用程序,然后用cocoawebView显示meteor服务器产生的内容。 所以问题是如何让meteor/节点与cocoa应用程序一起分发,以便用户不必手动安装它。

未被捕获的meteor中的types错误

我有这个代码: Meteor.subscribe('practices'); Session.set('practice', 'Practice 1'); Template.laps_t.laps = function () { var obj = Practices.findOne({name: Session.get('practice')}); return obj.lap_n; }; 我得到一个错误: Uncaught TypeError: Cannot read property 'lap_n' of undefined 。 我知道lap_n实际上是obj一个属性。 我没有使用自动订阅。 有任何想法吗? 编辑: 解决了。 多谢你们。 如果(obj){return obj.lap_n}就像你说的那样做了。

meteor模板没有使用点击事件进行更新

我试图做一个使用meteor会议(坚持视图的用户是)的反应式菜单..但它不工作,Session.get('currentView')得到改变(在Chrome控制台的teste),但页面不要再次渲染。 html的 <div class="col-1-1 menu" style="height: 42px;"> <ul> <li><a class="dashButton" href="#"># Dashboard</a></li> <li><a class="myJobsButton"href="#">Jobs</a></li> <li><a class="helpPageButton"href="#">Help</a></li> </ul> <br style="clear:left"/> </div> {{#if currentViewIs "dashboard"}} {{> dashboard}} {{else}} {{#if currentViewIs "myJobs"}} {{> myJobs}} {{else}} {{#if currentViewIs "helpPage"}} {{> helpPage}} {{else}} {{> dashboard}} {{/if}} {{/if}} {{/if}} client.js Template.userPage.currentViewIs = function (view) { if( Session.get('currentView') == view) return true; […]

如何在IntelliJ中debuggingmeteor

我想在IntelliJ中debuggingMeteor应用程序的JavaScript代码。 我阅读以下教程中的说明: http://www.jetbrains.com/idea/webhelp/running-and-debugging-node-js.html http://wiki.jetbrains.net/intellij/Remote_JavaScript_debugging_with_WebStorm_and_PHPStorm 第一个教程解释了debugging一个Node.js应用程序。 第二个教程解释了debugging一个JavaScript应用程序。 有人可以解释如何在Intellij中debuggingmeteor应用程序吗?

meteor,错误:无法等服务器上使用Meteor.setTimeout()光纤

我对meteor相当陌生,所以我可能会错过这里的一个关键洞察。 无论如何,我想向用户指出同时有多less其他用户在网站上。 我有一个AuditItems集合,它已经存储了kv-pairs对于who , what when以及我可以用于这种types的计算。 我的Collections查询运行一个new Date()参数,所以我不能只是观察结果,我必须定期重新运行查询。 然后,我通过调用Deps.Dependency changed Deps.Dependency 。 这里是代码: // publishing counts of the users that are logged on // at the moment Meteor.publish("user-activity", function () { var self = this; self.added("user-activity", "all-recent-activity", {'operations': getRecentActivityCountsCache}); self.ready(); Deps.autorun(function() { self.changed("user-activity", "all-recent-activity", {'operations': getRecentActivityCounts()}); }); }); var getRecentActiveCountsDependency = new Deps.Dependency; var getRecentActivityCountsCache […]

MeteorJS集合没有定义

superpack是一个使用_wrapAsync变形的npm包。 为什么插入到集合UserSession会导致错误,指出集合未定义? 服务器/助理/ b.js // Init var SUPERPACK = Meteor.require('superpack'); var superpack = SUPERPACK(a,b); // Get Info superpack.getInfoSync = Meteor._wrapAsync(superpack.getInfo.bind(superpack)); var data = superpack.getInfoSync(); UserSession.insert({ 'account': data }); collections/ UserSession.js UserSession = new Meteor.Collection('user_sessions'); 错误(服务器端): ReferenceError: UserSession is not defined 使用仪表v0.6.6.3。

将对象转换为Meteor.JS把手中的数组后,无法拆分string

手把助手arrarify用于将对象的对象转换为对象的数组 handlebarsHelper.js Handlebars.registerHelper('arrayify',function(obj){ result = []; for (var key in obj) result.push({name:key,value:obj[key]}); return result; }); 客户端/视图/ main.html中 <template name="orderList"> {{#each arrayify orderList}} {{value.amount}} {{ value.name }} {{/each}} </template> 客户端/视图/ main.js Template.orderList.orderList = function() { // Retrieved from Collection orderList = { 12345: {name: "apples_mackintosh", amount: 10}, 12346: {name: "oranges_sunkiss", amount:5} }; return orderList; }; 问题:如何将模板值oranges_sunkiss呈现为“ […]

在openShift节点版本上meteor

meteor(v0.6.6.3)在openShift上,定制openShift nodeJS为0.10.21,mongoDB 2.2 我试图得到一个运行在openShift上的meteor应用程序。 我已经将nodeJS从openShift默认值0.10.5升级到了nodeJS 0.10.21,因为meteor最低需要这个nodeJS版本。 如果我打开一个ssh shell openShift,并让我节点版本比它显示我正确的0.10.21(节点 – 版本)的升级版本。 但是,如果我将启动meteor应用程序,他们会看到0.10.5的nodeJS版本(控制台用'process.version'注销),并再次重新启动… 有人能指出我可以看到发生了什么或者我做错了什么的方向。 谢谢

putObject使Nodejs中的服务器上的对象更大

我正在使用Nodejs尝试使用aws-sdk将图像推送到S3实例。 目前,它从客户端上的一个文件读取,然后将其保存在服务器上(我使用的是meteor框架)。我想推送到S3服务器,而不是保存在meteor服务器上。 当我尝试迁移它时,图像似乎在S3上增加了大约30%。 如果我尝试从S3下载它们,图像也不再可见,所以看起来它已经改变了编码或者什么。 这里是在客户端加载文件的代码: saveFile = function( blob, name, path, type, callback ) { var fileReader = new FileReader(); var method; var encoding = 'binary'; var type = type || 'binary'; switch( type ) { case 'text': method = 'readAsText'; encoding = 'utf8'; break; case 'binary': method = 'readAsBinaryString'; encoding = 'binary'; break; default: […]