我是mongoDB的新手,对数据库一无所知,所以想知道MongoDB中的集群是什么,在MongoDB中连接到集群有什么意义?连接到一个是必须的还是我们可以连接到localhost?
我的contenteditable的工作方式是从数据库(MongoDB)获取数据并在表中显示数据后,它将在每行数据的末尾有两个名为edit和delete的按钮.按下编辑后,表格行将可供用户编辑,因此在进行编辑后,用户将单击"保存"按钮,然后对服务器执行ajax调用并发送更改,然后发送数据已成功更新的响应.这是关于表格的html代码.
<div id="table-wrapper">
<div id="table-scroll">
<table id="results" class="hidden" cellspacing=10px>
<thead>
<tr class = "spacing">
<th>SAM ID</th>
<th>Item Description</th>
<th>Issued QTY</th>
<th>Opening QTY</th>
<th>Closing QTY</th>
<th>Corrupted QTY</th>
<th>Remarks</th>
<th>NTA SAM Reference No.</th>
</tr>
</thead>
<tbody id="bResults">
</tbody>
</table>
<div id="noResults"></div>
</div>
Run Code Online (Sandbox Code Playgroud)
这是我的js代码.
$(".navbar-search").one('click', function(){
$.ajax({
url: "http://localhost:3000/api/queryAllRecord", // server url
type: "POST", //POST or GET
contentType: "application/json",
// data to send in ajax format or querystring format
dataType : "JSON", //dataType is you telling jQuery what kind of
response to expect …Run Code Online (Sandbox Code Playgroud)