【发布时间】:2017-11-22 01:37:38
【问题描述】:
我有一个 mongodb 集合,我正在使用 node.js 。我有一个“衣服”的集合,我在这张表中表示它的数据:
<h2>Clothes</h2>
<table class="table">
<thead>
<tr>
<th>price</th>
<th> date </th>
<th>Delete</th>
</tr>
</thead>
<tbody>
<% for(var i = 0; i < result.length; i++){%>
<% if(result[i].type == "price"){%>
<tr>
<td><%= result[i].price %></td>
<td><%= result[i].date %></td>
<td>
<form action="/delete-price" method="POST">
<input type="hidden" name="id" value="<%= result[i]._id %>">
<input type="submit" name="submit" value="Delete">
</form>
</td>
</tr>
<%}%>
<%}%>
</tbody>
</table>
日期可以是一周中的任何一天。我的问题是,我想让用户通过表单提交一定的预算(这很容易),但我想同时比较所有行的所有费用
该表和数据库一样正常工作且功能齐全。
一个例子:
Ex: If the user enters budget of 200$ , I should go to all the rows in
"Clothes" , check the prices, if the prices is greater than the budget, this
row should be flagged .
我怎样才能做到这一点?我对此很陌生。我尝试在 html 和 css 中执行此操作,但这是我的知识停止的地方
【问题讨论】: