UNPKG

usda-food-data-api-schema

Version:
24 lines (19 loc) 619 B
import mongoose from "mongoose"; import FoodNutrientSource from "./FoodNutrientSource.js"; const { Schema } = mongoose; export default interface FoodNutrientDerivation { id: Number; code: String; description: String; foodNutrientSource: FoodNutrientSource; } export const FoodNutrientDeviationSchema = new Schema<FoodNutrientDerivation>({ id: Number, code: String, description: String, foodNutrientSource: { type: Schema.Types.ObjectId, ref: "FoodNutrientSource" } }); mongoose.model("FoodNutrientDerivation", FoodNutrientDeviationSchema);