Replies: 1 comment
-
sorry, but in Meteor server .. collection2. (on window 10, Meteor 2.4, node v14.17.6 , npm 7.24.1) class Collection extends Mongo.Collection {
findOne(selector){
const result = super.findOne(selector);
return result;
}
insert(doc, callback) {
const ourDoc = doc;
const result = super.insert(ourDoc, callback);
return result;
}
}
export const link = new Collection('links');
link.schema = {
ymd: {
type: String
, min: 8
, max: 8
, custom: function() {
if(!moment(this.value, "YYYYMMDD", true).isValid())
return 'badDate'; //"[label] is not a valid date"
}
},
}
link.attachSchema(link.schema); set link.schema not cool. I think it's a silent error code. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
thank you for all your efforts.
I also want to do schema validation on the client side.
I want to use the validation of json data on the server side
through the same schema structure
and store it in the DB.
on the server(meteor) side,
...If there are validation errors,
The web server seems to stop responding and fall into a stopped state.
Beta Was this translation helpful? Give feedback.
All reactions