I’m using node simple schema to define a schema to use for an API for example:
export const Data = new Mongo.Collection('data');
schema = {}
export const schema.data = new SimpleSchema({
name: {
type: String,
label: "Device's Name",
},
message: {
type: String,
label: "Message",
},
data: {
type: Date,
autoValue: function() {
if (this.isUpdate) {
return new Date();
}
},
},
}, { tracker: Tracker });
Data.attachSchema(data.schema);
Now I want users to be able to define and add new field with type to the data collection using a predefined method from the server that user can call on the API-Client. This method should add a new field with type to the data collection. Ex:
api.call.addData( surName: {type: Array, label: “User Surname”, OtherSimpleSchema_attribute…}). But the defined field should be available only to the actual user.
Any help