meteor

How to store the result of a stdout? [duplicate]

丶灬走出姿态 提交于 2019-12-25 05:21:10
问题 This question already has answers here : How to return a sdtout from a server to a client inside a string? (2 answers) Closed 2 years ago . I do a UNIX command to list all my files that ends with .svg like this 'getExistingFiles': function () { var list =""; child = exec_tool('cd /home/me/files/; ls *.svg', function (error, stdout, stderr) { list = stdout; console.log(typeof list); console.log("LIST:------------"); console.log(list); return list; if (error !== null) { console.log('exec error:

Set the return value of Meteor JS Helper, inject this dynamically into template

跟風遠走 提交于 2019-12-25 05:14:35
问题 EDIT: Given the answers below, using Meteor Deps seems like the ideal play since I want to share data between two distinct templates, and it should be reactive to any changes that occur. To clarify: source of my data is Template.reactiveTable and the destination is Template.buttons . When the data in reactiveTable changes, I want the buttons to reflect this. END EDIT I am looking to set the value of buttons based on the content of a table (specifically, the <h1> values). buttons.html:

Set the return value of Meteor JS Helper, inject this dynamically into template

被刻印的时光 ゝ 提交于 2019-12-25 05:14:01
问题 EDIT: Given the answers below, using Meteor Deps seems like the ideal play since I want to share data between two distinct templates, and it should be reactive to any changes that occur. To clarify: source of my data is Template.reactiveTable and the destination is Template.buttons . When the data in reactiveTable changes, I want the buttons to reflect this. END EDIT I am looking to set the value of buttons based on the content of a table (specifically, the <h1> values). buttons.html:

Promises in Mocha Unit Tests

£可爱£侵袭症+ 提交于 2019-12-25 04:45:47
问题 This question is related to Using Promises to test Meteor - Mocha Like Louis suggested, I have replicated the same issue in a smaller program, so that you can reproduce this. And in this one too Mocha doesn't care about the assert statement. The catch block of the promises gets this error. /server/main.js import { Meteor } from 'meteor/meteor'; export const myCollection = new Mongo.Collection('mycollection'); export const addObject = function (id) { myCollection.insert({ name: 'test ' + id })

mongodb/meteor collection check if subdocument field exists when field is a variable

北战南征 提交于 2019-12-25 04:34:31
问题 I'm trying to use something as follows collection.find({"myField."+variable : {$exists: true}) But obviously that doesn't work because the collections doesn't take strings. Instead, I tried building a a fully query string in JSON but that won't parse correctly because I'm just searching for a field name and not an entire object var qry = '{"myField.'+variable+'"}'; //no go I've also tried the meteor collection fields logic var qry = 'myField.'+variable; collection.find({}, {fields: {qry: 1}})

SSL Inspection error:CERT_UNTRUSTED when adding meteor package

两盒软妹~` 提交于 2019-12-25 04:29:14
问题 At work we are behind an SSL inspection appliance which resigns all traffic with the companies root CA. Is there a way to add this certificate to Meteor. When not suing meteor we can tell NPM where our CA cert lives: npm config set cafile /path/to/cert.pem Is there a way to add the certificate to Meteor's trusted list? Here is the error in full: $ meteor add twbs:bootstrap Unable to update package catalog (are you offline?) If you are using Meteor behind a proxy, set HTTP_PROXY and HTTPS

How to make a Meteor Collection non reactive depending on a url?

人盡茶涼 提交于 2019-12-25 04:28:30
问题 Hi I am building a magnetic poetry game with meteor which I am pretty green with. http://test-magnets.meteor.com/ Currently it is collaborative it works great. I am now trying to have it so that you can play privately without people messing with your poems. I used Iron Router to generate a url based on the userID router.js Router.map(function() { this.route('home', { path: '/' }); var user = Meteor.userId(); this.route('private', { path: '/' + user }); }); I had the idea of using a fridgeId

IronRouter: template is rendered before call in waitOn is finished

不羁的心 提交于 2019-12-25 04:27:12
问题 I want to create charts based on data from my collection. This data is called by an aggregate pull in my router-settings and set by Session.data in the template.rendered function. The Meteor.call is placed in the waitOn-function. If the template is rendered, the data is not present. I tried onBeforeAction, action, setTimeout... but i can't set the render-function to wait until the call-data is present. I tried to set the calls in the onBeforeAction and onRun hooks, in the action, waitOn and

Limit number of field return from mongodb in Meteor

不问归期 提交于 2019-12-25 04:25:25
问题 I am have a collection that stores documents that contains user informations like Email, Phone Number, etc. I want to be able to return only 5 fields that exist in the document, for example. Email: [a@a.com, b@b.com] Mobile: [012345, 6789] Country: USA Service: [Wholesale, Retail] Zip: 30001 City: New York It will return: a@a.com, 012345, USA, Wholesale, 30001 or if the document is Service: [Wholesale, Retail] Zip: 30001 City: New York It will return: Wholesale, 30001, New York Basically

Using this.added in Meteor

感情迁移 提交于 2019-12-25 04:21:02
问题 I'm trying to transform a publication, and this is my code: Meteor.publish('appointments.waiting', function () { var self = this, count = 0; Appointments.find().forEach(function (appointment) { var patients = Patients.find({_id: appointment.patient_id}).fetch(); var first_name = patients[count].profile.first_name, middle_name = patients[count].profile.middle_name, surname = patients[count].profile.surname, name = surname + ', ' + first_name + ' ' + middle_name; self.added('appointments',