Questions tagged [simple-schema]

A simple, reactive schema validation package for Meteor. It's used by the Collection2 and AutoForm packages, but you can use it by itself, too.

258 questions
11
votes
4 answers

Separate form validation with Meteor

I'm using collection2 and I'm trying to get it to handle validation is a specific way. I have a profile schema which looks kind of like this: Schema.UserProfile = new SimpleSchema({ name: { type: String, optional: false } …
SeanWM
  • 16,789
  • 7
  • 51
  • 83
6
votes
2 answers

Using objects as options in Autoform

In my Stacks schema i have a dimensions property defined as such: dimensions: { type: [String], autoform: { options: function() { return Dimensions.find().map(function(d) { return { label: d.name, value:…
Chris
  • 9,603
  • 15
  • 46
  • 67
6
votes
1 answer

Structure role-management in meteor-app with alanning:roles

I need some advice for building a correct role schema and management in my meteor-app. Structure Im using alanning:roles@1.2.13 for adding role management functionallity to the app. There are four different user-types: Admin, Editor, Expert and…
user3848987
  • 1,627
  • 1
  • 14
  • 31
6
votes
1 answer

Meteor using namedContext to addInvalidKeys to an AutoForm form returning an error

I have the following SimpleSchema where I am trying to add custom validation to validate against entering duplicate customer name, yet whenever I try to save a new customer I get error: Exception in delivering result of invoking …
MChan
  • 6,842
  • 27
  • 83
  • 132
5
votes
1 answer

Meteor AutoForm: How to update schema values with array of sub-documents?

I am new to Meteor AutoForm. I want to update player docs with country doc. Below is my code. If I add{{> afQuickField name="country"}} in AutoForm it doesn't works. {{> afQuickField name="name"}} alone works fine. How do I add entire country docs…
Ramesh Murugesan
  • 4,727
  • 7
  • 42
  • 67
4
votes
1 answer

How to pass a default value for a field in 'insert' form?

How to pass a default value for a field in 'insert' form? I'm using Meteor's packages: Autoform, Collections2, and Simple-Schema. My process is: A User selects some value in a list on a page, then The 'insert' from opens, and I want that one field…
3
votes
1 answer

Getting Error: List id must be an object after adding schema to todos example in Meteor

The todos example for Meteor works fine. However, when I added a schema to the Todos and Lists collections I keep getting "Error: List id must be an object". Any help would be greatly appreciated. Added were: meteor add aldeed:simple-schema …
Mark M
  • 49
  • 3
3
votes
1 answer

Meteor Error: User Not Found

I have been working on extending the Meteor.users schema which work fine but after I create the first user in a Meteor.startup() and tried logging in I get a "User Not Found" error. Even though i can see the user in the mongo shell. Here is my…
jessiPP
  • 436
  • 1
  • 6
  • 21
3
votes
1 answer

Unique Field in Meteor AutoForm

I have a Meteor AutoForm collection schema with the following field and I am trying to make it unique. It doesn't allow the same value in the same case but when I change the case of the value, value get inserted, so how can I prevent to insert…
Mahendra Garg
  • 516
  • 1
  • 9
  • 27
3
votes
2 answers

Meteor using a collection.find() in another collection

I need to proceed a collection.find() in another collection. I have a collection named Orders. Orders = new Mongo.Collection('orders') Orders.attachSchema(new SimpleSchema({ clientId: { type: String }, orderDate: { type: Date } }); It…
3
votes
1 answer

How to add Meteor.userId() to SimpleSchema via autoValue?

Inside my libs folder I create collections using SimpleSchema. I want to add the Meteor.userId to some fields via autoValue like this: Collection = new Meteor.Collection('collection'); Collection.attachSchema(new SimpleSchema({ createdByUser: { …
3
votes
2 answers

How to pass _id to autoForm via hidden field in Meteor?

I have a collection of projects and the Meteor.users collection. My goal is to add the document _id of a project to a username. HTML: