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
2
votes
2 answers
updating collection with embedded objects in meteor
I tried to add data from a JSON response in my collection in meteor. Unfortunately all the things I found on Stack overflow didn't work. In some cases I got an error back like:
Exception in callback of async function: MongoError: Cannot update…

Hijlco Lankhorst
- 31
- 6
2
votes
1 answer
Meteor fetch on client undefined outside of helper
I am trying to fetch an entry in a collection with:
client/views/home.js:
criticalCrewNumber = ConfigValues.find({
name: 'criticalCrewNumber'
}).fetch()[0].value;
But I'm getting error:
Uncaught TypeError: Cannot read property 'value' of…

KindOfGuy
- 3,081
- 5
- 31
- 47
2
votes
1 answer
Simple Schema minDate maxDate
I think this is a simple question. I'm using simple schema and I want to have a minDate and maxDate. The documentation talks about it in validation section but I'm not sure how to define it in the schema itself. Any help would be great. Thanks
Path:…

bp123
- 3,217
- 8
- 35
- 74
2
votes
0 answers
Meteor aldeed:autoform custom arrayField template not working
I've looked for tutorials about AutoForm's custom field templates but I'm not sure where I'm going wrong with mine. If anyone has any suggestions it would be greatly appreciated.
My Schema: One field is an Array of Objects.
guests: {
type:…

Maggie S.
- 1,076
- 4
- 20
- 30
2
votes
2 answers
MDG ValidatedMethod with Aldeed Autoform: "_id is not allowed by the schema" error
I'm getting the error "_id is not allowed by the schema" when trying to use an autoform to update a collection via a ValidatedMethod.
As far as I can see from this example and the official docs there is no expectation for my schema to include the…

tomRedox
- 28,092
- 24
- 117
- 154
2
votes
2 answers
How to set a unique id for an embedded document in Meteor?
I have setup my collections like this using Simple Schema :
SubLinkSchema = new SimpleSchema({
name: {
type: String,
label: 'Link Name',
unique: false
},
link: {
type: String,
regEx:…

THpubs
- 7,804
- 16
- 68
- 143
2
votes
1 answer
Simple Schema valid values lists
I'm using Simple Schema, and I'd like to have a way to validate the values in some fields against a predefined list or against another
Validate against a predefined, not changing list (like an enum). This could probably be done with a complicated…

port5432
- 5,889
- 10
- 60
- 97
2
votes
1 answer
SimpleSchema match any type but null
I'm planning to make a collection to hold different app-wide settings, like, say, amount of logged in users today, Google analytics tracking ID, etc. So I made a schema like this:
options_schema = new SimpleSchema({
key: {
type: String,
…

Alex K
- 6,737
- 9
- 41
- 63
2
votes
0 answers
Correct validation error in console, but no red border around select2 Meteor AutoForm input field
I am using an AutoForm with a meteor-autoform-select2 input field. My Schema looks like this:
Data.attachSchema(new SimpleSchema({
title: {
type: String,
label: "Title",
max: 30
},
users: {
type:…

user3475602
- 1,217
- 2
- 21
- 43
2
votes
1 answer
Get label for AutoForm option value in Meteor Simple Schema
In Meteor template {{parameter}} returns value of option for this schema:
new SimpleSchema({
parameter: {
type: String,
allowedValues: ['value_1', 'value_2'],
autoform: {
options: [
{label: "label_1", value: 'value_1'},
…

A. Z.
- 728
- 1
- 11
- 28
2
votes
4 answers
How to entirely skip validation in simple schema and allow incomplete documents to be stored?
I'm creating an order form and a schema defined for an Order (certain required fields such as address, customer info, items selected and their quantities, etc).
a. User visits site.
b. A unique ID is generated for their session as well as a…

fuzzybabybunny
- 5,146
- 6
- 32
- 58
2
votes
1 answer
How to access own user id in AutoForm Select2 Meteor?
I am using Select2 AutoForm and I have the following schema:
Schema = {};
Schema.users = new SimpleSchema({
users: {
type: [String],
autoform: {
type: "select2",
options: function () {
…

user3475602
- 1,217
- 2
- 21
- 43
2
votes
0 answers
Execution order of meteor-collection-hook and simple-schema validation is different on the server and the client
I am using collection2, simple-schema and meteor-collection-hooks.
First test
// posts.js
Posts = new Mongo.Collection("posts");
Posts.before.insert((userId, doc) => {
console.log('Should see…

Benjamin Crouzier
- 40,265
- 44
- 171
- 236
1
vote
1 answer
How to declare simpleschema OR within subschema Meteor js 1.8
In my data schema I would like to have a nested object in an object. The nested object should be validated as well, but be able to contain different types of data. So there are several schema's for the same object data.
To clarify this:
Object >…

Sjaak Huisbraak
- 11
- 1
1
vote
1 answer
Error handling in Meteor.js with SimpleSchema
I'm working a project developing by Meteor.js & now I'm working for a validation something like that
import SimpleSchema from 'simpl-schema';
const CompanySchema = new SimpleSchema({
company_name: {
type: String,
min: 5,
…

jesica
- 645
- 2
- 13
- 36