0
나는 Feathers.js과 몽구스을 사용하고 있으며 서비스로 변경할 수없는 필드를 만들고 싶습니다.서비스 변경 방지 방법
// account-model.js - A mongoose model
//
// See http://mongoosejs.com/docs/models.html
// for more of what you can do here.
const mongoose = require('mongoose');
require('mongoose-type-email');
module.exports = function(app) {
const mongooseClient = app.get('mongooseClient');
const recovery = new mongooseClient.Schema({
token: { type: String, required: true }
}, {
timestamps: true
});
const account = new mongooseClient.Schema({
firstName: { type: String, required: true },
surname: { type: String, require: true },
phone: { type: String, require: true },
email: { type: mongoose.SchemaTypes.Email, required: true, unique: true },
birth: { type: Date, required: true },
gender: { type: String, required: true },
country: { type: String, required: true },
address: { type: String, required: true },
address2: { type: String, required: false },
city: { type: String, required: true },
postcode: { type: String, required: true },
password: { type: String, required: true },
status: { type: String, required true }
}, {
timestamps: true
});
return mongooseClient.model('account', account);
};
아무도 /account/<id>
에서 게시물을하지 않으며 분야 status
을 변경할 수 있습니다. 이 필드는 내부적으로 만 변경해야합니다. 일부 승인 서비스 요청.
이 동작을 어떻게 구현할 수 있습니까?