为什么mongoDB使用objectID?(Why mongoDB uses objectID?)
{ "_id" : ObjectId("4c2209f9f3924d31102bd84a"), "name" : "mongo" }
objectId究竟是什么目的? 这是使用时间戳生成的大数字。
如果我看到任何nosql是键值,我用键查询值。
这里我们使用key和value作为数据并使用find()函数。
那么,我想知道什么时候我们真的需要objectid? 授予用户访问权限以查看对象ID值的原因是什么?
阅读文档后,一个基本问题是mongo DB作为哈希表类型实现?
{ "_id" : ObjectId("4c2209f9f3924d31102bd84a"), "name" : "mongo" }
what exactly is the purpose of objectId? It's a big number that is generated using a timestamp.
If I see any nosql which is key-value, I query with key the value.
Here we use key and value in the as the data and use find () function.
So, I am trying to understand when we really need the objectid? What are the reasons behind that giving access to the user to view the value of the object ID?
After reading the docs, one basic question is mongo DB as hash table type implementation?
原文:https://stackoverflow.com/questions/6560928
满意答案
我用了
type: "GET", url: "http://stackoverflow.com/questions/32554239/ajax-post-without-refresh",
而不是你的
type: "POST", url: "http://****/new/action.php",
它工作正常。 (只需点击“运行代码段”,它会显示错误,因为该网址不支持跨域)
$(document).ready(function() { $("form#iscrizione").submit(function(){ var ordine = $("#ordine").val(); var cognome = $("#cognome").val(); $.ajax({ type: "GET", url: "http://stackoverflow.com/questions/32554239/ajax-post-without-refresh", data: "cognome=" + cognome + "&ordine=" + ordine, dataType: "html", success: function(risposta) { $("div#risposta").html(risposta); alert("ok!"); }, error: function(){ alert("Chiamata fallita!!!"); } }); return false; }); });
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <form id="iscrizione"> <input type="text" value="get" id="cognome"><input type="text" value="get" id="ordine"><input type="submit" value="get"></form><div id="risposta"></div>
I used
type: "GET", url: "http://stackoverflow.com/questions/32554239/ajax-post-without-refresh",
instead of your
type: "POST", url: "http://****/new/action.php",
AND it works fine. (Just click on "Run snippet", it shows an error because the url doesn't support cross-domain)
$(document).ready(function() { $("form#iscrizione").submit(function(){ var ordine = $("#ordine").val(); var cognome = $("#cognome").val(); $.ajax({ type: "GET", url: "http://stackoverflow.com/questions/32554239/ajax-post-without-refresh", data: "cognome=" + cognome + "&ordine=" + ordine, dataType: "html", success: function(risposta) { $("div#risposta").html(risposta); alert("ok!"); }, error: function(){ alert("Chiamata fallita!!!"); } }); return false; }); });
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <form id="iscrizione"> <input type="text" value="get" id="cognome"><input type="text" value="get" id="ordine"><input type="submit" value="get"></form><div id="risposta"></div>
相关问答
更多如何在成功发布AJAX后更新值/刷新页面(How to update values/refresh page after successful AJAX post)
AJAX间隔刷新?(AJAX Interval Refresh?)
如何在ajax post回调后刷新KendoUi网格(How to refresh the KendoUi grid after a ajax post callback)
Ajax发布没有刷新(Ajax post without refresh)
页面刷新时的Ajax POST?(Ajax POST on page refresh?)
使用ajax刷新div内容(Using ajax to refresh a div content)
MVC Core使用ajax发布数据并刷新页面上的部分(MVC Core use ajax to post data and refresh a section on the page)
Laravel 5在AJAX发布后刷新HTML(How to refresh HTML after AJAX post)
jQuery刷新表后是$ .ajax发送(jQuery Refresh table after is $.ajax send)
相关文章
更多MongoDB _id和ObjectId详解
Mongodb与spring集成(2)------实体映射
MongoDB数据类型
MongoDB的体系结构_深入浅出MongoDB(三)
MongoDB学习 (六):查询
solr mongoDB 对比
mongodb删除文档操作-使用shell和java操作mongodb文档
使用Java操作MongoDB_深入浅出MongoDB(五)
mongodb添加集合文档操作-使用shell和java操作mongodb文档
深入浅出MongoDB(一):认识MongoDB
最新问答
更多您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
在计算机拍照在哪里进入
使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
单页应用程序:页面重新加载(Single Page Application: page reload)
在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
Copyright ©2023 peixunduo.com All Rights Reserved.粤ICP备14003112号
本站部分内容来源于互联网,仅供学习和参考使用,请莫用于商业用途。如有侵犯你的版权,请联系我们(neng862121861#163.com),本站将尽快处理。谢谢合作!