简体   繁体   English

使用纯 javascript/jquery 从 Mongodb 客户端读取 JSON

[英]Read JSON from Mongodb client side with pure javascript/jquery

Is there a way to read JSON from a document in a Mongodb collection using only client-side inline javascript/jquery?有没有办法仅使用客户端内联 javascript/jquery 从 Mongodb 集合中的文档中读取 JSON? I don't know much about the subject so I would appreciate any literature/resources you could point me towards.我对这个主题了解不多,所以我会很感激你能指出我的任何文献/资源。 This might be totally impossible, I'm just looking for pointers.这可能是完全不可能的,我只是在寻找指针。 Any help is much appreciated!任何帮助深表感谢!

You should use AJAX to get the the info from the server-side您应该使用 AJAX 从服务器端获取信息

 $.ajax({
    url: "your url",
    type: 'GET',
    dataType: 'json', 
    success: function(res) {
        console.log(res);
    }
});

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM