0
我有一个流星的问题,以及我用滑块显示一些组。当你点击一个组时,我会显示一些用户。如何比较mongoDB中的两个字段?
我想只显示用户属于管理员组,在组管理,并只对团体管理者等用户管理器...
HTML:
<template name="manage">
{{> header}}
<div class="menu">
<div class="accordion">
<div class="accordion-group">
{{#each roles}}
<div class="accordion-heading country">
<!-- <img src="http://placehold.it/100x30" alt="country flag" style="float:left; margin: 3px 10px 0 3px; text-align:center;"/> -->
<p style="border: 1px solid grey; border-radius: 5px; font-weight: bold; width: 100px; height :30px; float:left; margin: 3px 10px 0 3px; text-align:center;">{{name}}</p>
<a class="accordion-toggle" data-toggle="collapse" href="#country{{_id}}">{{pays}} - {{lieu}} - {{increment}}</a>
</div>
<div id="country{{_id}}" class="accordion-body collapse">
<div class="accordion-inner">
<table class="table table-striped table-condensed">
<thead>
<tr>
<th>Utilisateurs</th>
<th>Nom</th>
<th>Prenom</th>
<th>Statut</th>
<th>ID</th>
</tr>
</thead>
<tbody>
{{#each users "1"}}
<!-- {{#if roles "lol"}} -->
<tr>
{{#each emails}}
<td>{{address}}</td>
{{/each}}
<td>{{profile.name}}</td>
<td>{{profile.name}}</td>
<td>OK</td>
<td>{{increment}}</td>
</tr>
<!-- {{/if}} -->
{{/each}}
</tbody>
</table>
</div>
</div>
{{/each}}
</div>
</div>
JS:
Template.manage.roles = function() {
return Meteor.roles.find();
};
Template.manage.users = function (inc) {
return Meteor.users.find({increment : inc});
};
所以,我试图比较数据库中的两个领域,但你有更好的解决方案吗? 对不起,我是新的流星:)
尼斯!!!非常感谢 !是工作 !但是,我可以从检索一个值吗?因为
如果使用event.target.innerHTML,则可以从标记中检索值,否则也可以使用event.target.getAttribute('value') – Pent