meteor

Merging collections in Meteor

梦想与她 提交于 2020-01-09 10:42:32
问题 Imagine you have multiple collections you want displayed on a single social news feed, for example Posts and Users (new signups). How would you reactively display both in a list sorted by creation date? Idea 1 - merging in client You publish the entities separately, and in the client, sort each of them by date, and merge them into a single sorted array, which you then display in an {{#each}} iterator. Problem: AFAIK this requires flattening the reactive cursors into static arrays, so now the

Merging collections in Meteor

為{幸葍}努か 提交于 2020-01-09 10:42:29
问题 Imagine you have multiple collections you want displayed on a single social news feed, for example Posts and Users (new signups). How would you reactively display both in a list sorted by creation date? Idea 1 - merging in client You publish the entities separately, and in the client, sort each of them by date, and merge them into a single sorted array, which you then display in an {{#each}} iterator. Problem: AFAIK this requires flattening the reactive cursors into static arrays, so now the

generating and serving static files with Meteor

大城市里の小女人 提交于 2020-01-09 04:23:12
问题 I'm looking to create static text files based upon the content of a supplied object, which can then be downloaded by the user. Here's what I was planning on doing: When the user hits 'export' the application calls a Meteor.method() which, in turn, parses and writes the file to the public directory using typical Node methods. Once the file is created, in the callback from Meteor.method() I provide a link to the generated file. For example, 'public/userId/file.txt'. The user can then choose to

Meteor WebSocket handshake error 400 with nginx

倖福魔咒の 提交于 2020-01-09 04:22:11
问题 I managed to deploy meteor on my infrastructure (Webfactions). The application seems to work fine but I get the following error in the browser console when my application starts: WebSocket connection to 'ws://.../websocket' failed: Error during WebSocket handshake: Unexpected response code: 400 回答1: WebSockets are fast and you don't have to (and shouldn't) disable them. The real cause of this error is that Webfactions uses nginx, and nginx was improperly configured. Here's how to correctly

How to show correct profile picture Meteorjs

百般思念 提交于 2020-01-07 09:15:56
问题 I am using CollectionFs to Upload profile pictures. Uploading and storing the image is successful. I can insert and show the image alright for one user but the problem is: For multiple users, when a user visit other users profiles, He sees his own picture rather than seeing the profile owner's picture! I understand its the mongo query I have in my helper function thats causing the issue but can't just get it to work no matter how many "This._id" I Try. Here is the javaScript Router.route(

Meteor and Phaser - error loading asset

天涯浪子 提交于 2020-01-07 09:03:48
问题 I run Phaser with Meteor I get an error when loading a .png file from the directory. Could someone please provide some guidance on how to fix it. My environment is ubuntu 14.04 Meteor 1.1.0.2 Phaser v2.3.0 My directory structure and folders are cmt@ubuntu:~/projects/myMeteorProjects/issueReplication2$ ls -R .: client index.css index.html public server ./client: client.js phaser.js ./public: car.png index.html is <head> <title>phaser and meteor</title> </head> <body> <h1>Phaser and Meteor</h1>

Internal Server Error in OAuth for Google

为君一笑 提交于 2020-01-07 07:44:10
问题 EDIT: I was able to resolve the original error here when I realized my ROOT URL was set to my IP address rather than my domain. However, I now have a new issue. My client ID is the same as the original post below. This works fine in the local app, but in production, the popup flashes for a second and then the login box displays "Internal Server Error". I can't see any other messages that would explain it. I am using the service-configuration package to load the settings, as follows:

Operation failed: ExchangeBind; 404 (NOT-FOUND) with message "NOT_FOUND - no exchange 'dead.letters-q.1'

那年仲夏 提交于 2020-01-07 06:55:52
问题 as referenced in a previous question, i'm trying to use the wascally npm package with meteor and it's throwing what seems to be a setup/config error about my exchanges W20150925-14:22:34.692(-4)? (STDERR) W20150925-14:22:34.693(-4)? (STDERR) /Users/rkstar/dev/projects/wacoosta/.meteor/local/isopacks/npm-container/npm/node_modules/wascally/node_modules/when/lib/fatal.js:12 W20150925-14:22:34.693(-4)? (STDERR) throw e; W20150925-14:22:34.693(-4)? (STDERR) ^ W20150925-14:22:34.694(-4)? (STDERR)

How do you toggle menu button for simple sidebar bootstrap 3 w/Meteor using jQuery

爷,独闯天下 提交于 2020-01-07 06:26:20
问题 I'm trying to create a menu button, for my off canvas sidebar. I'm using the cannonstar:sidebar-bootstrap3 (AKA start bootstrap simple sidebar). http://ironsummitmedia.github.io/startbootstrap-simple-sidebar/ http://seegatesite.com/bootstrap/simple_sidebar_menu.html# My problem is that it isn't working can anyone who willing to help me, look at my code please; thanks to all that help. P.S. I'm using Meteor & Boostrap-3 with the iron-router package. <div id="wrapper"> <div id="sidebar-wrapper"

Meteor run a function when a mongo collection gets updated

筅森魡賤 提交于 2020-01-07 05:50:48
问题 I am trying to do a simple prototype using Meteor (I am very new to Meteor). I have the following in an isClient block Template.imageList.helpers({ images: function() { return Images.find({}); }, } ); Then for quick demo purposes I am inserting data with meteor mongo and the following db.images.insert({ imgSrc: "http://mysite/img1.png", createdAt: new Date() }) This works and I can see the change reflected on the ui but I need to also run a client side javascript function when this occurs. I