Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR TYPESCRIPT

mongoose nested require

var jobSchema = Schema({
  negotiation: { state: { type: String, required: hasNegotiation } }
});

function hasNegotiation() {
  return this.negotiation && Object.keys(this.negotiation).length > 0;
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #mongoose #nested #require
ADD COMMENT
Topic
Name
1+7 =