Ground:db considerations


#1

I want to make my app work offline, and I want to use Ground:db.

Is it OK to use method calls to create documents (will it even work with Ground)? For example:

// /client/forms.js
Template.forms.events({
  'click #add-form': function(e) {
    e.preventDefault();
    Meteor.call('createForm', {name: "Foo", value: "Bar"});
  }
});

// /server/collection.js
Forms = new Mongo.Collection('forms');
Forms.allow({
  insert: function() {
    return false;
  },
  update: function() {
    return false;
  },
  remove: function() {
    return true;
  }
});

Meteor.methods({
  'createForm': function(form) {
    Forms.insert(form);
  }
});
// need to set the allow functions to 'true' with this option.

or should I do the insert directly from the client, like so

Template.forms.events({
  'click #add-form': function(e) {
    e.preventDefault();
    Forms.insert({name: "Foo", value: "Bar"});
  }
});