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

MeteorJS: trouble with dates in autoform and simpleschema

I use Simple Schema, Collection2 and Autoform. For example my collection is: experience = new SimpleSchema ({ date: { type: Date, label: "From", autoform: { 'formgroup-class': 'col-sm-4', …
1
vote
1 answer

Meteor collection2 array with Strings and Object

i'm using Meteor with collection2 and I have an array that looks like this: productTypes = ["string1", "string2", "string3", {Other: "test"}] Essentially there will be anywhere from 0 to 7 strings in the array, and Other: 'Test' may or may not be…
ruevaughn
  • 1,319
  • 1
  • 17
  • 48
1
vote
3 answers

Populating SELECT options from database in SimpleSchema

Using SimpleSchema in Meteor with the AutoForm + Select2 plugins , i am trying to generate the Options for a Select field from the database. The 'occupation' collection is published, and a collection 'Occupation' is defined in Meteor. In…
Andy59469
  • 1,674
  • 2
  • 13
  • 18
1
vote
2 answers

Meteor + MongoDB: Database pattern

I'm new to Meteor and trying to figure out how to best design this database to store and publish data. I thought it would make sense to use these…
user1400803
1
vote
1 answer

Setting label to false in schema not working

I'm trying to remove the label in schema. Every time I set it to false it errors or does nothing. Schema.User = new SimpleSchema({ classifications: { type: Schema.Classification, optional: true, label: false } });
bp123
  • 3,217
  • 8
  • 35
  • 74
1
vote
0 answers

how to unset a field in meteor simple schema

I want to unset a field in simpleSchema but the field is neither shown in set or unset under hooks before:{ update:function(mod){ console.log(mod["$set"]); console.log(mod["$unset"]) This is what I have done to unset…
Sai Ram
  • 4,196
  • 4
  • 26
  • 39
1
vote
1 answer

insert meteor.userId into mongoDB

I want to initialize a field in simpleSchema. I want set userId into a string field. here is the schema: AdsSchema = new SimpleSchema({ title: { type: String, label: "Title" }, insertedBy: { type: String, label: "Inserted By", …
1
vote
1 answer

How to fetch usernames of not logged in users in collection helpers?

I have a Questions collection, which I have defined using SimpleSchema in a file "collections.js", which is in questions > lib. This collection has an askedBy field. It is an array of Strings that stores the userIds of the people who asked the…
Samudra
  • 1,013
  • 1
  • 14
  • 21
1
vote
2 answers

Simple Schema and multiple forms

I have a user profile schema that looks sort of like this: Schema.UserProfile = new SimpleSchema({ name: { type: String, optional: false }, gender: { type: String, optional: false, allowedValues:…
SeanWM
  • 16,789
  • 7
  • 51
  • 83
1
vote
0 answers

updating objects in double nested arrays in a collection

Having this schema: Task = new SimpleSchema({ _id: { type: String, regEx: SimpleSchema.RegEx.Id, autoValue: function(){ return Random.id(); } }, title: { type: String, label: "Task title", …
Borra
  • 23
  • 7
1
vote
1 answer

using both of "collection" and "schema" attribute in autoform

I have one "Ads" collection in mongoDB, and too many schema in following format: AdsBaseSchema = new SimpleSchema({ _parentId: { type: String, optional: true }, title: { type: String, label: "Title", max: 200 } …
1
vote
1 answer

Change the date format of meteor-autoform-bs-datepicker

Is there a way to change the format of aldeed/meteor-autoform-bs-datepicker to dd/mm/yyyy. I've tried the code below but it doesn't work. date: { type: Date, optional: true, autoform: { type:…
bp123
  • 3,217
  • 8
  • 35
  • 74
1
vote
1 answer

Combining simple schema errors

I'm trying to combine fields using simple schema. It works for Schema.UserProfile however it doesn't work for Schema.accountStatus. If I try and populate the field when I create a new account it errors. Any thoughts on why, would really help,…
bp123
  • 3,217
  • 8
  • 35
  • 74
1
vote
1 answer

Collection2 removes object properties

This is my simplified collection & its schema: Comments = new Mongo.Collection('comments'); Comments.schema = new SimpleSchema({ attachments: {type: [Object], optional: true}, }); Comments.attachSchema(Comments.schema); And this is my…
Tacaza
  • 539
  • 1
  • 4
  • 12
1
vote
1 answer

Meteor: Set autoValue of field to anther profiles usersId

I'm new to Meteor and programming, if this doesn't make sense or you need more info please let me know. I'm loading a profile page of another user. So I have 2 userIds; this.userId and the other users Id. I want to use autoValue to save both…
bp123
  • 3,217
  • 8
  • 35
  • 74