Skip to content

Instantly share code, notes, and snippets.

@dalthonmh
Created March 30, 2020 23:56
Show Gist options
  • Save dalthonmh/5b8d3586974744c4ef6967fd42d534dd to your computer and use it in GitHub Desktop.
Save dalthonmh/5b8d3586974744c4ef6967fd42d534dd to your computer and use it in GitHub Desktop.
Mongo Seeding CLI | examples/import-data-json/models/order.js
const mongoose = require("mongoose");
const Plate = mongoose.model("Plate");
const Schema = mongoose.Schema;
const OrderSchema = Schema({
order_detail: [{ type: Schema.Types.ObjectId, ref: Plate }],
date: Date,
table: Number
});
module.exports = mongoose.model("Order", OrderSchema);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment