meteor

SimpleSchema: Conditionally required field is not working

狂风中的少年 提交于 2019-12-25 09:28:16
问题 This is how I'm doing a validation using SimpleSchema with a conditionally required field ( module ). So this should only be required if type has the value 'start' client const module = 'articles', _id = 'bmphCpyHZLhTc74Zp' console.log(module, _id) // returns as expected 'articles' and 'bmphCpyHZLhTc74Zp' example.call( { type : 'start', module: module, _id : _id }, (error, result) => { if (error) console.log(error) } ) server example = new ValidatedMethod({ name : 'example', validate: new

Creating a many to many relationship in a complex manner between 3 collections

心已入冬 提交于 2019-12-25 09:25:36
问题 I have 3 collections, meteor.user() , Categories and Posts . A user can choose to follow any category's posts by saving the id of the category in an array in meteor.user() The end goal of this is that the user has a Personal stream where only the posts in the categories they are are following show up. Each post inside the Posts collection has within it an array of the Categories it's featured in. and each category has within it an array of posts, each post in the array has a field of ID of

Why is the customized Meteor accounts verification email not display as HTML?

99封情书 提交于 2019-12-25 09:18:03
问题 Here's my code in imports/api/friends/methods.js : import {Meteor} from "meteor/meteor"; import {Accounts} from "meteor/accounts-base"; if (Meteor.isServer) { Accounts.emailTemplates.siteName = "...."; Accounts.emailTemplates.from = "example01 <example01@gmail.com>"; Accounts.emailTemplates.verifyEmail.from = function () { return "example01 <example01@gmail.com>"; }; Accounts.emailTemplates.verifyEmail.text = function(user, url) { return '<h1>Thank you for your registration.</h1><br/><a href=

Meteor helpers return nothing

◇◆丶佛笑我妖孽 提交于 2019-12-25 09:16:52
问题 I would like create helpers for return string data : className() { let className; Meteor.call('getIp', (err, res) => { if (err) { console.log(err); } else { // User ip let ip = res.data.ip; let userLikers = this.likers; // Si l'utilisateur a déjà aimé le post if (userLikers.includes(ip)) { className = 'icon-favorite'; } else { className = 'icon-favorite-border'; } console.log(className); return className; } }); } My console.log(className) is good, and i don't understand why my return is empty

Meteor : autorun won't make my code dynamic

走远了吗. 提交于 2019-12-25 09:03:20
问题 I'm working hard on a meteor App which goal is to dynamically display on a google map the path of a vehicle, for example a boat on the sea. Now, I see this library called gmaps.js, and since it is available on npm (just like google maps api) I decide to use this as a solution to draw of the map. So, I have one page that add a geographic position (/runs/send) in the database each time I click on a button (this is enougth for testing). Then, on my other page (/runs/show) the goal is to get that

Meteor: Minimongo does not synchronize with MongoDB

时间秒杀一切 提交于 2019-12-25 08:58:43
问题 My Meteor application using Angular 2 and Typescript seems not to load the server data on the client side: I have followed this tutorial, both with autopublish turned on and of, but each time several tries to display data on client side with different collections failed. Unlike in the tutorial (RC4), I am using Angular 2 RC5. My clients' main.ts looks as following: import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; import { AppModule } from './app.module'; const

Meteor path helper not returning anything

こ雲淡風輕ζ 提交于 2019-12-25 08:57:48
问题 to learn meteor, I'm following Sacha Greif's book 'Discovering Meteor'. The current source code is reflected here-> https://github.com/stopachka/meteor-hackernews Right now, I'm trying to add a 'discuss' link to the post_item, which is supposed to render the single post_item. <template name="postItem"> <div class="post"> <div class="post-content"> <h3><a href="{{url}}">{{title}}</a><span>{{domain}}</span></h3> </div> <a href="{{postPagePath title}}" class="discuss btn">Discuss</a> </div> <

I am getting on error when run “meteor run ios”

南楼画角 提交于 2019-12-25 08:55:53
问题 I am getting an error when run "meteor run ios" WARNING: Attempting to install plugin cordova-plugin-splashscreen@3.2.1, but it should have a minimum version of 4.0.0 to ensure compatibility with the current platform versions. Installing the minimum version for convenience, but you should adjust your dependencies. Is there any update cordova. Thanks. 回答1: I could fix this issue using following steps-: meteor add cordova:cordova-plugin-meteor-webapp@https://github.com/meteor/cordova-plugin

Meteor - autocomplete with “distinct” feature?

我是研究僧i 提交于 2019-12-25 08:53:37
问题 I have a collection Songs which contains data in the following format: {artist:"Dream Theater", title: "Pull me under"}, {artist:"Dream Theater", title: "Finally free"} I am using the package mizzao-autocomplete There are more than 5000 entries, so I definetely need server-side autocompletion. On server I published the collection: Meteor.publish("autocompleteArtists", function(selector, options) { Autocomplete.publishCursor(Songs.find(selector, options), this); this.ready(); }); Client

Typescript not inserting into Mongo Collection

与世无争的帅哥 提交于 2019-12-25 08:47:43
问题 I am using Ionic2 with Meteor/MongoDb. I have a collection , that I am trying to insert a message object into. However, the code seems to freeze where it tries to do the insert . However, if I try insert the message object from a different place (i.e. invoke setLocalMessage(message: Message) ), it does so successfully. This makes me think, the problem is not with the collection or message objects, but rather the way I am calling the function that does the insert. private