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.
Questions tagged [simple-schema]
258 questions
1
vote
0 answers
Meteor SimpleSchema: prevent form submission using asynchronous custom validation
I have implemented a custom validation function using the example referenced in the SimpleSchema documentation for validating the uniqueness of a username. In the example, an asynchronous call is made and a custom validation message is displayed if…

Olsen W
- 11
- 1
1
vote
1 answer
Passing method parameters through template
I have the following method in meteor (I use schemas) which I call in order to insert an object in the database.
userAddOrder: function(newOrder, prize) {
var currentPrize;
if (prize == undefined) {
currentPrize =…

StefanL19
- 1,476
- 2
- 14
- 29
1
vote
0 answers
Why custom validator in Meteor SimpleSchema is being called twice?
Code:
Event = new Mongo.Collection('event');
var eventSchema = new SimpleSchema({
name: {
type: String,
custom: function() {
console.log(this.field('name').value);
}
}
});
Property.allow({
insert: function(userId, doc) {
…

Raeef Refai
- 1,471
- 14
- 26
1
vote
0 answers
Using upsert with simpleschema returns null with no collection inserts
Hey guys I'm trying to use Meteor upsert like so.
console.log(vendorReviewArr);
var updateQuery = {$set: {vendorID: vendorIDVal}, $push: {reviews:vendorReviewArr}};
VendorReviews.upsert(
{vendorID: vendorIDVal},
updateQuery,
…

BaconJuice
- 3,739
- 13
- 56
- 88
1
vote
3 answers
Meteor collections. After altering schema, how to check for invalid documents? How to fix?
I'm using SimpleSchema and Collection2.
Before pushing a new version of my app, I'd like to check if any documents would be invalid with the new schema. Is there an automated way to do this?
Or a command line utility?
How do you release new…

Michael Cole
- 15,473
- 7
- 79
- 96
1
vote
0 answers
Angular Meteor 1.3 - Collection Helpers
I'm trying to get the most excellent dburles/meteor-collection-helpers package working with Angular Meteor 1.3. I have two collections.
Lists.attachSchema(new SimpleSchema({
title: {
type: String
},
archived: {
type: Boolean
}
…

sauce
- 592
- 4
- 9
- 25
1
vote
0 answers
Meteor quickforms and simple-schema not working
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({
…

Shahid Shabbir
- 25
- 8
1
vote
0 answers
Breaking Up Meteor Schema in autoform
I have a SimpleSchema that looks like this:
ArticleSchema = new SimpleSchema({
title: {
type: String,
label: 'Title',
max: 200
},
desc: {
type: String,
label: 'Description',
max: 1000,
…

Moshe
- 551
- 3
- 7
- 17
1
vote
1 answer
Meteor SimpleSchema insert with nested object
I have the following collection which has a nested object address which is defined using the Collection2 Meteor Package. I am unable to insert the data for this nested object...
Sample data
var addresses = [{
"venue": "Kirkstall Abbey",
…

Matt D. Webb
- 3,216
- 4
- 29
- 51
1
vote
1 answer
Adding a custom input field to an AutoForm in Meteor
{{#autoForm schema="schema" id="submitoffer" type="method" meteormethod="submitoffer"}}
{{> afQuickField name="startLocation"}}

Austin Gayler
- 4,038
- 8
- 37
- 60
1
vote
1 answer
Meteor pub/sub issues
This below is my collection code
Competitions = new Mongo.Collection("competitions");
var CompetitionsSchema = new SimpleSchema({
year: {
type: String
},
division: {
type : String,
allowedValues: ['Elite',…

mohsinali1317
- 4,255
- 9
- 46
- 85
1
vote
2 answers
How to add user id information in the schema and also hide form autoforms?
I am learning the ropes of Meteor and kind of lost here. I am using collections2, autoform for building my application. I want to store the collection along with user id information. So that when we retrieve the collection from the server, I want to…

Nair
- 7,438
- 10
- 41
- 69
1
vote
2 answers
How to check if boolean is true in custom validation simple-schema in Meteor
I have the following Schema:
Games.attachSchema(new SimpleSchema({
title: {
type: String,
label: "Title",
max: 30
},
multiplayer: {
type: Boolean,
label: "Multiplayer",
denyUpdate: true
…

user3475602
- 1,217
- 2
- 21
- 43
1
vote
2 answers
meteor - How to add a subdocument as reference with SimpleSchema
I have the following SimpleSchema
Schema.Team = new SimpleSchema({
name:{
type:String
},
members: {
type: [Schema.User],
optional:true
}
});
I would like to insert (on the server) a new team document with the…

znat
- 13,144
- 17
- 71
- 106
1
vote
1 answer
MeteorJS & Collection2. How to create Schema with data of type 'Time'?
Hi I'm trying to create a MongoDB Collection with a Collection2 schema connected to an Autoform (specifically a Quickform if possible) That allows me to store a time and date, not just a date.
For a date, the JSON validation is type: Date, - is…

Louisswiss
- 33
- 3