user1966211
user1966211

Reputation: 873

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?

If so, how can I do that?

Upvotes: 0

Views: 120

Answers (1)

Hubert OG
Hubert OG

Reputation: 19544

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'});
}

Upvotes: 1

Related Questions