1

I am using the following code in cars.js which is in lib folder,

       Cars = new Mongo.Collection('cars');

    Cars.allow({
      insert: function(userid, doc) {
        return !!userid;
      }
    });

    CarSchema = new SimpleSchema({

    name: {
            type: String,
            label: "Cars"
          },

    desc: {
            type: String,
            label: "Car Condition"
          },

    author: {

            type: String,
            label: "Author",
            autoValue: function() {
              return this.userid
            },
            autoform: {
              type: "hidden"
            }
    },

    createdAt: {
                type: Date,
                label: "Created at",
                autoValue: function() {
                  return new date()
                },
                autoform: {
                  type: "hidden"
                }
              }

    });

    Cars.attachSchema ( CarSchema );

this is quickform code,

    <template name="newcar">
    <div class="new-car-container">
      {{> quickForm collection="Cars" id="insertcarform" type="insert" class="new-car-form"}}
    </div>
    </template>

I see a form UI but when I go to mongodb shell and show collections, I dont see my collections named 'cars' there.

P.s. I am very new coder and learner, please help me with this and if possible explain in detail how to fix it. Thanks

  • On console, I am getting the following; `Meteor.addCollectionExtension` is deprecated, please use `CollectionExtensions.addExtension` – Shahid Shabbir Dec 29 '15 at 18:44
  • What does it say when you submit your form in your webconsole? Also, make sure you put autoform debug mode on : https://github.com/aldeed/meteor-autoform#troubleshooting . Your collection seems OK, I usually put the allow/deny logic after I attached the Schema but it shouldn't make a fuss. – ko0stik Dec 30 '15 at 11:19

0 Answers0