草庐IT

Meteor-AutoForm

全部标签

node.js - Meteor 如何接收对 MongoDB 查询结果的更新?

几个月前我问了一个问题,Meteor似乎有答案。Which,ifany,oftheNoSQLdatabasescanprovidestreamof*changes*toaqueryresultset?Meteor如何接收对MongoDB查询结果的更新?谢谢,克里斯。 最佳答案 你想要query.observe()。假设您有一个带有标签字段的Posts集合,并且您希望在添加带有important标签的帖子时收到通知。http://docs.meteor.com/#observe//collectionofpoststhatinclud

mongodb - 如何在我的 meteor 应用程序数据库中使用 mongoimport?

我可以使用mongoimport将csv数据导入非meteormongodb数据库,但我不知道如何将csv导入我的meteor应用程序数据库。我学会了如何为我的meteor应用程序(meteormongo)运行mongoshell,但我无法从shell运行mongoimport。mongoimport的mongodb文档说Inthisexample,mongoimportimportsthecsvformatteddatainthe/opt/backups/contacts.csvintothecollectioncontactsintheusersdatabaseontheMongo

mongodb - 如何在我的 meteor 应用程序数据库中使用 mongoimport?

我可以使用mongoimport将csv数据导入非meteormongodb数据库,但我不知道如何将csv导入我的meteor应用程序数据库。我学会了如何为我的meteor应用程序(meteormongo)运行mongoshell,但我无法从shell运行mongoimport。mongoimport的mongodb文档说Inthisexample,mongoimportimportsthecsvformatteddatainthe/opt/backups/contacts.csvintothecollectioncontactsintheusersdatabaseontheMongo

node.js - meteor 订阅不更新集合的排序顺序

//SnippetfromTemplate{{#eachelements}}{{>post-elementthis}}{{/each}}//SnippetfromClientMeteor.subscribe('thePosts');//SnippetfromServerMeteor.publish('thePosts',function(){returnPosts.find({},{sort:{createdAt:-1},reactive:true});});当我这样做时……Posts.insert({body:postBody,createdAt:newDate()});发布文档被添

node.js - meteor 订阅不更新集合的排序顺序

//SnippetfromTemplate{{#eachelements}}{{>post-elementthis}}{{/each}}//SnippetfromClientMeteor.subscribe('thePosts');//SnippetfromServerMeteor.publish('thePosts',function(){returnPosts.find({},{sort:{createdAt:-1},reactive:true});});当我这样做时……Posts.insert({body:postBody,createdAt:newDate()});发布文档被添

javascript - 如何使用 meteor 进行 API 调用

好的,这里是twitterAPI,http://search.twitter.com/search.atom?q=perkytweets谁能给我任何关于如何调用此API或使用Meteor链接的提示?更新:这是我尝试过的代码,但没有显示任何响应if(Meteor.isClient){Template.hello.greeting=function(){return"WelcometoHelloWorld";};Template.hello.events({'clickinput':function(){checkTwitter();}});Meteor.methods({checkTwi

javascript - Meteor.js 部署到 "example.com"还是 "www.example.com"?

我最近使用以下命令部署了一个meteor应用:$meteordeployexample.com后来(认为它是相同的)使用以下:$meteordeploywww.example.com它最终为应用程序的两个不同版本提供服务,一个托管在example.com中,另一个托管在www.example.com中。我可以还原其中一个部署吗?我应该恢复哪一个?如果没有,我应该在我的域名提供商上设置什么样的配置? 最佳答案 当人们访问您的页面时,您希望他们看到mydomain.example还是www.mydomain.example?如果是myd

mongodb - 如何使用 Meteor Upsert

让我的Meteorupsert功能工作有点麻烦。我是相当新的(200行代码),我遇到了一些麻烦。集合继续插入额外的行,而不仅仅是更新。我花了过去30分钟在谷歌上搜索,但找不到任何我能理解的例子。这是我的代码:Values.upsert({//Selectorsource:"SourceOne",currency:"USD"},{//Modifiervalue:res.data['data']['last']['value'],time:Date.now(),});我也试过if(Values.find({},{fields:{'source':"SourceOne",'currency'

javascript - 在 Meteor 应用程序中实现 MongoDB 2.4 的全文搜索

我正在考虑向Meteor应用程序添加全文搜索。我知道MongoDB现在支持此功能,但我对实现有一些疑问:在Meteor应用中启用文本搜索功能(textSearchEnabled=true)的最佳方式是什么?有没有办法在您的应用中添加索引(db.collection.ensureIndex())?如何在Meteor应用程序中运行Mongo命令(即db.quotes.runCommand("text",{search:"TOMORROW"}))?因为我的目标是将搜索添加到Telescope,我正在寻找一种“即插即用”的实现,它需要最少的命令行魔法,甚至可以在Heroku或*.meteor.

javascript - Meteor 文档中的消息计数示例如何工作?

无法完全理解thedocs中的这个示例...我尝试了很多不同的方式来运行它,以便观察它是如何工作的,等等。你如何订阅这个?我们可以包含完成这项工作所需的客户端代码吗?是否有一个名为messages-count的集合?Room是消息的集合吗?我们可以在示例中包含集合定义吗?任何关于这方面的提示都会很棒!注意:这是最初发布此问题时出现的代码(2012年5月)。现在更简单了。//server:publishthecurrentsizeofacollectionMeteor.publish("messages-count",function(roomId){varself=this;varuu