简体   繁体   English

流星js客户端直接连接到mongodb

[英]Meteor js client side connect directly to mongodb

Using meteor js on the client side and from this condition: if (Meteor.isClient), is it possible to connect to a mongodb collection directly? 在这种情况下,在客户端使用流星js:如果(Meteor.isClient),是否可以直接连接到mongodb集合?

If so, how can I do that? 如果是这样,我该怎么做?

Well, that's what Meteor is all about! 好吧,这就是流星的全部内容! See the documentation . 请参阅文档 Simple example: 简单的例子:

if(Meteor.isClient) {
  Documents = new Meteor.Collection('documents');
  var document = Documents.findOne({title: 'Example'});
}

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

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