meteor

Meteor - connect collections of multiple databases

徘徊边缘 提交于 2020-01-25 21:10:32
问题 In Meteor (server side), is it possible to create collections of multiple databases? Let's say I want to connect to two different databases and mount their collections in meteor. My concern are collections with the same name in both databases (for example "users"). Is there any way to have 2 collections named "users" but from 2 different databases (connections)? Thanks! EDIT: The other question does not address my main issue: what if I want to mount (connect) two collections named "users"

Test if email is send in Meteor Velocity

試著忘記壹切 提交于 2020-01-25 20:58:45
问题 Is it possible to confirm emails are being sent in Meteor Velocity tests? I thought I could just have a method in tests with the same name that override/duplicates the method, but that doesn't work. I tried this: In my regular code: Meteor.methods( email: (parameters) -> sendAnEmail(parameters) ) In tests : Meteor.methods( email: (parameters) -> differentBehaviorForTesting(parameters) # I could call some super() here if necessary ) But this always gets me a Error: A method named 'email' is

Test if email is send in Meteor Velocity

怎甘沉沦 提交于 2020-01-25 20:58:06
问题 Is it possible to confirm emails are being sent in Meteor Velocity tests? I thought I could just have a method in tests with the same name that override/duplicates the method, but that doesn't work. I tried this: In my regular code: Meteor.methods( email: (parameters) -> sendAnEmail(parameters) ) In tests : Meteor.methods( email: (parameters) -> differentBehaviorForTesting(parameters) # I could call some super() here if necessary ) But this always gets me a Error: A method named 'email' is

File upload and download using meteor

。_饼干妹妹 提交于 2020-01-25 20:26:39
问题 I am new to Meteor and web development in general, what I would like to achieve for my meteor web-app is the following: A user can click on a button to upload a .zip file (I want this to get stored to my local database as I am building a proof-of-concept run in localhost). the file gets associated with a particular object of a Mongodb Collection. On the client page associated with that object one can click on a button to download that .zip file. All the information I found regarding this

How to Iterate through Object inside Collection Meteor Mongo

妖精的绣舞 提交于 2020-01-25 13:20:13
问题 If I do the following search: VideoCourses.find({'_id': 'jkwehrjewrew'}).fetch()[0].videos I get the following: Object {first: "firstvideo.html", second: "secondvideo.html", third: "thirdvideo.html"} My question, is how can iterate through the collection. I want to render one video at a time, so I can render the first video, and then on click, render the second, etc. The thing is, I have many sets of videos, so this should be done dynamically. It should iterate through the next video.first,

WebDriver element is returning false for isVisible/waitForForVisible

拟墨画扇 提交于 2020-01-25 11:52:29
问题 I am working on my first set of Cucumber tests in a Meteor app, but I cannot get the login step to work. My app uses a custom login plugin I wrote specifically for this project. Here is the step, as I currently have it defined with debug output: this.Given(/^I am logged in as a\/an "([^"]*)"$/, function(roleName, callback) { this.browser .url(url.resolve(process.env.HOST, '/')) .waitForExist('#appSignIn'); this.browser.getHTML('#appSignIn', function(err, html) { if (err) { console.log('err: '

How would I return the order of MongoDB Posts by time Favourited by user?

半世苍凉 提交于 2020-01-25 10:59:16
问题 I have a web app with posts that the user can Favourite or "Like". When they fav a post the postId gets added to an array in the users collection. Meteor.users.update({_id:this.userId},{$addToSet:{liked:postId}}); I am able to return these posts by retrieving this array of "liked" posts and using the $in operator. Posts.find({ _id: { $in: user.liked } }, {sort: {upcount: -1, views: -1} }); At the moment as you can see they are being sorted firstly by the upcount which is just the number of

How to show related subdocument properties in Meteor

白昼怎懂夜的黑 提交于 2020-01-25 10:29:06
问题 I am new to Meteor/MongoDB and I'm trying to use something like this to describe a user and his stuff in a meteor project: { _id: whatever, name: "John Doe", myToys: [ {toy_id: "truck", quantity: 2}, {toy_id: "legoset", quantity: 4} ] } I have another collection that has all those toy_ids and their properties (manufacturer, popularity, etc. and other properties that might change later, which is why I have this in a separate collection). How would I best code it in meteor and template it to

Unable to load client certificate private key file

空扰寡人 提交于 2020-01-25 05:51:30
问题 I am unable to create Apple Push Notification cert files. When I test .pem files I get an error. openssl s_client -connect gateway.sandbox.push.apple.com:2195 -cert pushapp_cert_dev.pem -key pushapp_key_dev.pem will give an error: unable to load client certificate private key file 140735327015760:error:0906D06C:PEM routines:PEM_read_bio:no start line:pem_lib.c:703:Expecting: ANY PRIVATE KEY I am following these instructions: https://github.com/raix/push/wiki/iOS-Micro-Walkthrough pushapp_cert

React-search basic example

瘦欲@ 提交于 2020-01-25 03:51:17
问题 I'm trying to get react-search to work in my Meteor app. This is my main App.js in the imports folder: import Search from 'react-search'; import React, { Component } from 'react'; import PropTypes from 'prop-types'; import ReactDOM from 'react-dom'; ... class App extends Component { ... render() { let items = [ { id: 0, value: 'ruby' }, { id: 1, value: 'javascript' }, { id: 2, value: 'lua' }, { id: 3, value: 'go' }, { id: 4, value: 'julia' } ] console.log(items) return ( <div class="">