javascript - Meteor: Accessing another collection with an id in an #each block -


so have 2 collections, appliers & profiles,

appliers = {_id,idappliersprofile} 

&

profile = {_id,profilename} 

so question if #each appliers, how access profile collection profile instead of id? thanks.

assuming both sets of docs published client, 1 solution looks this:

html

<template name="mytemplate">   {{#each appliers}}     {{#with getprofile idappliersprofile}}       <div>{{profilename}}</div>     {{/with}}   {{/each}} </template> 

js

template.mytemplate.helpers({   appliers: function () {     return appliers.find();   },    getprofile: function (id) {     return profile.findone(id);   } }); 

Comments

Popular posts from this blog

java - nested exception is org.hibernate.exception.SQLGrammarException: could not extract ResultSet Hibernate+SpringMVC -

sql - Postgresql tables exists, but getting "relation does not exist" when querying -

asp.net mvc - breakpoint on javascript in CSHTML? -