meteormeteor-autoformsimple-schemameteor-collection2

Autoform insert no restrictions


I'm trying to create a public autoform that gathers data. As a result, the people using the form don't have userIds. How do I create an insert form with no restrictions?

This is what I've previously used however it requires as user to be registered.

Collection.allow({
  insert: function(userId, doc) {
    return !!userId;
  },
});

Solution

  • Just change it to this:

    Collection.allow({
      insert: true,
    });
    

    Basically it allows anyone to insert a record to your database.