meteor

Meteor Dropdown list get and set

倖福魔咒の 提交于 2019-12-31 22:55:12
问题 What is the best way to get and select values from a dropdown list (and also in radio) in Meteor. I have created a helper: Template.categories.helpers({ categories: ["facebook", "news", "tv", "tweets"] }); and in html ... <select class="form-control" id="category"> {{> categories}} </select> ... <template name="categories"> <option disabled="disabled" selected="selected">Please Select</option> {{#each categories}} <option value="{{this}}">{{this}}</option> {{/each}} </template> In case of

Upload Data to Meteor / Mongo DB

血红的双手。 提交于 2019-12-31 17:59:13
问题 I have a Meteor app and would like to upload data (from csv) to a meteor collection. I have found: solutions (e.g. Collectionfs) which deal with file uploads methods for uploading directly to the underlying mongo db from the shell references to meteor router - but I am using the excellent iron-router, which does not appear to provide this functionality My requirement is that the app user be able to upload csv data to the app from within the app. I do not need to store the csv file anywhere

Upload Data to Meteor / Mongo DB

守給你的承諾、 提交于 2019-12-31 17:59:05
问题 I have a Meteor app and would like to upload data (from csv) to a meteor collection. I have found: solutions (e.g. Collectionfs) which deal with file uploads methods for uploading directly to the underlying mongo db from the shell references to meteor router - but I am using the excellent iron-router, which does not appear to provide this functionality My requirement is that the app user be able to upload csv data to the app from within the app. I do not need to store the csv file anywhere

How to generate new Meteor login tokens (server side) in order to make a quick login link

半腔热情 提交于 2019-12-31 10:40:35
问题 Meteor has a loginWithToken method, and there are resume tokens in the user object. So one can login using one of these tokens with loginWithToken . That works. Is there a way to generate new login tokens, or should I just use the resume tokens to create a quick login link? 回答1: As Johnny said, you can use the Accounts._generateStampedLoginToken() function, which is actually nothing special, just the following function: _generateStampedLoginToken = function () { return { token: Random.secret(

How to control where Meteor runs

天涯浪子 提交于 2019-12-31 09:06:09
问题 I'm installing Meteor (framework) on my AWS EC2 (micro) instance and followed the instructions and after creating a test project I ran meteor on that directory giving me the expected [[[[[ /var/www/html/meteortest ]]]]] Running on: http://localhost:3000/ But I can't navigate to my server's localhost in my browser to see the hello world example project. Is there a way I can make meteor work on something like : http://mydomain.com/meteortest/ or http://mydomain.com/meteortest:3000 回答1: The way

PM2 + Meteor Environment Setup

耗尽温柔 提交于 2019-12-31 09:05:21
问题 I am trying to setup Meteor to use pm2 (https://github.com/Unitech/pm2) instead of forever as the node process monitor. I have had no luck in getting the environment variables that a Meteor application needs to be seen by the pm2 process. Here is my process: export MONGO_URL="mongodb://localhost:27017/meteor" export PORT=4000 export ROOT_URL="https://beta.example.com/" pm2 start main.js --name MyMeteorApp In the error log from pm2 I see that my Meteor application is complaining that it cannot

handlebars.js “each” loop inside another “each” loop 3

…衆ロ難τιáo~ 提交于 2019-12-31 08:57:54
问题 Suppose I want to build a dynamic table. How do I run each inside each. If the only varible that represents current item is this . {{#each by_width}} {{#each by_height}} {{this}} // how do refer to this from the outer loop? {{/each}} {{/each}} 回答1: You can use ../ to access the parent in a Handlebars template: {{#each by_width}} {{#each by_height}} w: {{../this}} h: {{this}} {{/each}} {{/each}} That of course assumes that by_height is inside each element of by_width , if they're both at the

Meteor how to perform database migrations?

点点圈 提交于 2019-12-31 08:29:09
问题 How do you perform database migrations with Meteor? With Ruby on Rails there is ActiveRecord::Migration. Is there an equivalent mechanism in Meteor? For example, I make an app with some user data. I'm storing the data in Mongo using a JSON format. The app changes, and the JSON database schema needs to change. I can write a migration method to change the schema, however, I only want this to run if the server database is out of date. 回答1: There's nothing built in for this. What I've done myself

Updating Meteor.users from client

自闭症网瘾萝莉.ら 提交于 2019-12-31 05:49:07
问题 I have a form that tried to update meteor.users with extra information about users with the following helper Template.Profile.events({ 'submit form': function(e) { e.preventDefault(); var post = { firstName: $(e.target).find('[name=firstname]').val() }; Meteor.users.update( { _id: Meteor.userId() }, { $set: { 'firstName': post.firstName }} ); } }); however, i get update failed: Access denied Another question is, I am wondering whether I should do extra update straight to Meteor.users

JavaScript setInterval not being properly bound to correct closure

寵の児 提交于 2019-12-31 04:53:21
问题 Problem Hi people, I'm reasonably new to JavaScript and I come from the very object-oriented world of Python and Java, that's my disclaimer. There are two chunks of code below, alternative implementations, one in JavaScript, one in Coffeescript. I am trying to run them on the server in a Meteor.js application. The problem I am experiencing is when calling the function "setInterval" using the bound-method "this.printSomething" as my callback, once that callback is executed, it loses scope with