Meteor-Community-Packages / meteor-collection2

A Meteor package that extends Mongo.Collection to provide support for specifying a schema and then validating against that schema when inserting and updating.
https://packosphere.com/aldeed/collection2
MIT License
1.02k stars 108 forks source link

attachSchema with new simpl-schema package #364

Closed macsj200 closed 6 years ago

macsj200 commented 7 years ago

Hello, I'm trying to migrate to simpl-schema, and when I try to attach a schema I get the error Error: Invalid definition for pick field.

There are other extra fields on the new schema that I think the validator is rejecting. Do you have any ideas about how to fix this?

As far as I can tell, these are the new keys.

I20170511-10:28:43.137(-7)? SimpleSchema {    
I20170511-10:28:43.138(-7)?   pick: [Function: pickOrOmit],
I20170511-10:28:43.138(-7)?   omit: [Function: pickOrOmit],
I20170511-10:28:43.138(-7)?   _constructorOptions: { humanizeAutoLabels: true },
I20170511-10:28:43.138(-7)?   _docValidators: [],
I20170511-10:28:43.139(-7)?   messageBox: MessageBox { language: 'en', messageList: { en: [Object] } },
I20170511-10:28:43.140(-7)?   _cleanOptions: 
I20170511-10:28:43.140(-7)?    { filter: true,
I20170511-10:28:43.140(-7)?      autoConvert: true,
I20170511-10:28:43.140(-7)?      removeEmptyStrings: true,
I20170511-10:28:43.140(-7)?      trimStrings: true,
I20170511-10:28:43.140(-7)?      getAutoValues: true,
I20170511-10:28:43.140(-7)?      removeNullsFromArrays: false,
I20170511-10:28:43.140(-7)?      extendAutoValueContext: {} },
I20170511-10:28:43.140(-7)?   version: 2 }
macsj200 commented 7 years ago

Maybe I should open/migrate this issue to the new collection2 repo, thoughts?

MaxGuitet commented 7 years ago

I had the same issue and using aldeed:collection2-core@2.0.0 instead seems to solve it.

aldeed commented 6 years ago

Closing old issues. Please comment if this is still an issue and should be reopened.