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
1
vote
0 answers

Meteor Upsert Syntax with Nested Values

I am having trouble trying to get a Collection.upsert to work in Meteor 1.4.3.2. My app pulls in active listings from eBay and inserts them into the database if they don't already exist, otherwise it updates the listing that is already stored. So,…
Ticdoc
  • 248
  • 3
  • 15
1
vote
1 answer

Uniforms: Creating custom field

I have the following Simple Schema defined: import SimpleSchema from 'simpl-schema'; export const Comments = new Mongo.Collection("comments"); export const CommentsSchema = new SimpleSchema({ comments: Array, "comments.$": Object, …
1
vote
0 answers

Meteor collection2 does not validate on the client side

I am using collection2 with meteor to set default values. However when i run the method Meteor.call('commands.insert', {}) on the client, it just sets new document's ID, and only when the result from server comes it replaces the document with the…
1
vote
1 answer

SimpleSchema is not a constructor

My app constantly crashes with this error. TypeError: SimpleSchema is not a constructor at attendances.js (imports/api/attendances/attendances.js:44:27). I've googled it and the StackOverflow solution doesn't work. I'm running simpl-schema and…
bp123
  • 3,217
  • 8
  • 35
  • 74
1
vote
1 answer

How to update a part of an array sub document in MongoDB

I have this document in my mongodb collection: { "_id": "YLRM9Wi7f6tp6qNbS", "sessionId": "hLDkkJKR4Muik6tbe", "userId": "ZYoG4cH8HcCDPMDGr", "shopId": "J8Bhq3uTtdgwZx3rz", "workflow": { "status": "", "workflow": ["String"] }, …
codejockie
  • 9,020
  • 4
  • 40
  • 46
1
vote
1 answer

Meteor - node simple schema validate data to match schema

I want to change my Rest-API validation to node simple schema for schema definition and collection2@core for schema validation. I want to use the Person schema to validate the data provided by the users. Schemas = {}; Schemas.Person = new…
danyhiol
  • 594
  • 2
  • 7
  • 26
1
vote
1 answer

autoValue in SimpleSchema for update does not set given value

I am using below field in SimpleSchema, "fileNo": { type: String, label: "File No.", autoValue: function() { console.log('this', this); console.log('typeof this.value.length ', typeof this.value.length); …
Ankur Soni
  • 5,725
  • 5
  • 50
  • 81
1
vote
1 answer

conditionally suppress field validation for SimpleSchema during Bulk Insert

I am using Meteor 1.5 with MongoDB 3.2 I am using below Simple Schema to insert into Clients Collection. import { Mongo } from 'meteor/mongo'; import SimpleSchema from 'simpl-schema'; SimpleSchema.extendOptions(['autoform']); export const Clients =…
Ankur Soni
  • 5,725
  • 5
  • 50
  • 81
1
vote
1 answer

SimpleSchema: How to validate an specific array

As you can see below there is an array parameter passed to the validated method. For validation I'm using SimpleSchema. client const url = "/articles/bmphCpyHZLhTc74Zp" example.call({ item: url.split('/') }) server example = new ValidatedMethod({ …
user3142695
  • 15,844
  • 47
  • 176
  • 332
1
vote
1 answer

SimpleSchema validation for object array

I would like to validate this object array: [ { _id : 'NpxZFT4TwfDvwbtKX', parent: 'T4TwfDvwbtKXNpxZF', order: 1 } ] How do I do that, as this is not working: new SimpleSchema({ _id : { type:…
user3142695
  • 15,844
  • 47
  • 176
  • 332
1
vote
1 answer

Aldeed Simple-Schema, how to use allowed values in a field from another one?

I am trying to build a kind of specific simple schema for a collection and i would like to make sure that : when the user enter a new select in my selectsCollection, he will put one of the options value as selected value. For…
E.B
  • 141
  • 3
  • 15
1
vote
1 answer

Unrecognised schema error

Did you try adding ? 'name': { type: String, optional: true, uniforms: TextField } I'm getting an error while trying to implement vazco/uniforms with simpleschema. The error message is, Invariant Violation: Unrecognised schema: [object…
bp123
  • 3,217
  • 8
  • 35
  • 74
1
vote
0 answers

SimpleSchema/Collection2 insert exception

I'm trying to get a single text field to insert a string into my collection. I'm getting this error: Exception while invoking method 'categories.insert' TypeError: func is not a function at…
aviemet
  • 1,463
  • 1
  • 15
  • 19
1
vote
1 answer

Simple-schema wont update

I'm trying to update a MongoDB collection using $set. The field within the collection doesn't exist. When I try to add the field, the collection briefly stores the data and then the data disappears and returns an error ClientError: name.first is not…
bp123
  • 3,217
  • 8
  • 35
  • 74
1
vote
1 answer

Meteor 1.4. AutoForm validation message not showing

I've added autoform packege (meteor add aldeed:autoform) I've added collection2-core packege (meteor add collection2-core) I've installed simpl-schema (npm i --save simpl-schema) But form still does not working…