Given a User Model in a node app with JugglingDB
User = schema.define('User', {
name : String,
email : String,
API_KEY : String,
created : {type: Date, default: Date.now},
});
I would like the API_KEY attribute to be "read-only". So the following data:
var data = {
name : 'Test account',
email : 'test@test.com',
API_KEY : 'Some key'
}
Is accepted as:
var data = {
name : 'Test account',
email : 'test@test.com'
}
In:
var user = new User(data);
So this way only the server can create an API_KEY for users. Is this possible?