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