1var mongoose =require('mongoose');
2var Schema = mongoose.Schema;
3
4var msg = new Schema({
5 messageType: String,
6 timestamp: Number,
7 messagestatus: String
8});
9
10var standardmessage = new Schema({
11 id: Number,
12 name: String,
13 type: String,
14 message: [msg]
15});
1var fields = { 'properties.OBJECTID': 1, 'properties.TIMESTAMP': 1 };
2var query = Feature.find({id: 1}).select(fields);
1var jobSchema = Schema({
2 negotiation: { state: { type: String, required: hasNegotiation } }
3});
4
5function hasNegotiation() {
6 return this.negotiation && Object.keys(this.negotiation).length > 0;
7}