meteor

meteor/mongodb: Use different DB for authentication & read/write

痴心易碎 提交于 2019-12-24 16:02:10
问题 meteor allows to specify the DB using the env variable MONGO_URL: "mongodb://user:password@host:port/meteorDB" Meteor will then automatically use the "meteorDB" database to authenticate against and all collections will refer to this database and read/write to it. However, I use mongodb cloud manager to setup my users. It saves all users to the admin DB rather than having separate users saved in each database. I would like to use the "admin" DB for authentication and the "meteorDB" for data

server side fonts directory in pdfmake in meteor app

筅森魡賤 提交于 2019-12-24 15:45:59
问题 I am trying to create and save a pdf on the server. I have used meteorhacks:npm packaged and installed pdfmake on the server side. My code is in a subdirectory under server directory. I am using just the example to make sure I can generate a basic pdf. var fonts = { Roboto: { normal: 'fonts/Roboto-Regular.ttf', bold: 'fonts/Roboto-Medium.ttf', italics: 'fonts/Roboto-Italic.ttf', bolditalics: 'fonts/Roboto-Italic.ttf' } }; var PdfPrinter = Meteor.npmRequire('pdfmake/src/printer'); var printer

Angular not working correctly with Meteor 1.3.1

流过昼夜 提交于 2019-12-24 15:42:56
问题 I am following www.angular-meteor.com tutorial on a windows computer. But when I run meteor in console I only see: A blank screen besides socially ... So it seems like some angular packages does not work with Meteor 1.3.1 . Here is output from meteor list : accounts-password 1.1.7 Password support for accounts angular 1.3.9_2 Everything you need to use Angu... angularui:angular-google-maps 2.3.2 angular-google-maps (official) angularui:angular-ui-bootstrap 0.13.0 Native AngularJS (Angular)

materialize modal in Meteor how to trigger modal

岁酱吖の 提交于 2019-12-24 15:37:26
问题 I think I'm confused on how to trigger a modal from the Materialize Modal package. Materialize Modal I've got the package loaded and I'd like to use one of the pre-baked modals. JS: MaterializeModal.form({ title: "Enter some Data!", bodyTemplate: "my-form", callback: function(error, response) { if (response.submit) { // Iterate over form results & display. for (var field in response.form) { Materialize.toast(field + ": " + response.form[field], 5000, "green"); } } else { Materialize.toast(

Filtering records according to dropdownlist

老子叫甜甜 提交于 2019-12-24 15:32:49
问题 I need to filter the listing or records according to selection in dropdownlists. I have three dropdowns that needs to filter the records reactively in collaboration with each other. i.e value selection in one dropdownlist should filter the records effected by other dropdownlist values. var filterAndLimitResults = function (cursor) { if (!cursor) { return []; } var raw = cursor.fetch(); var currentChosenCategory = chosenCategory.get(); var currentChosenCity = chosenCity.get(); var currentJtype

Bind allowedValues to values from a collection in simple-schema

耗尽温柔 提交于 2019-12-24 15:03:04
问题 I'm using aldeed:simple-schema and here's the code: Cities = new Mongo.Collection('cities'); Cities.insert({ name: 'Oslo' }); Cities.insert({ name: 'Helsinki' }); Contact = new SimpleSchema({ city: { type: String, allowedValues: Cities.find().map((e) => e.name) // written ES6-style for readability; in fact, here goes an ES5 anonymous function definition } }); What it does is explicitly binds currently existing cities from Cities collection to Contact schema's certain field's allowed values,

Sort query by content (not by order)

放肆的年华 提交于 2019-12-24 14:44:58
问题 I am trying to sort my mongodb query according to the occurence of a string in one of its fields (an array). So given this example dataset: id | hits | categories ------------------------------ 1 | 18 | ['sports'] 2 | 12 | ['sports', 'news'] 3 | 22 | [] 4 | 20 | ['news'] I would like to make a query like this one ( $includes is obviously a made-up keyword): Records.find({}, {sort: {$includes: {categories: 'news'}, hits: -1}); Which would give me the resulting output: id | hits | categories --

Meteor nested views and yields

牧云@^-^@ 提交于 2019-12-24 14:28:32
问题 Iam setting up a basic structure of my future meteor app, Iam using meteor and angular. Wanted to combine iron router with ui router but it got pretty bad. So now Iam back on vanilla meteor for routing issue and the task is have standard multipage site but one of the pages is a complex panel with its own subpages. So I have a global layout with >yield and all content is being rendered there, now this dasboard page is also rendered into this yield, but it has to have yield of its own. How to

Is there a way to access Iron Router parameter from template in Meteor

≯℡__Kan透↙ 提交于 2019-12-24 14:24:26
问题 I have a route that has a parameter in it and I need to access it from many different templates. Below is one example of the route, there are several routes that are very similar just after the _occasionnId parameter it changes: For example: Route 1: /occasions/:_occasionId/cards/ Router 2: /occasions/:_occasionId/tables/ Here is my full code for each route, the only thing that really changes is the route path and the template. Router.route('/occasions/:_occasionId/cards/', { template: 'cards

Modifying user.profile using Accounts.onCreateUser for loginWithMeetup

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-24 13:41:08
问题 When a user creates an account using the the Meetup login package, I want to get a few more values such as the user's full name and URL to their profile picture then store them in user.profile. Currently, I'm checking if the service is "meetup", performing the following GET request and trying to store it in user.profile. if (service == "meetup") { var accessToken = user.services.meetup.accessToken; var request = Meteor.http.get('https://api.meetup.com/2/profiles',{ params : { access_token :