Skip to content

Instantly share code, notes, and snippets.

@jelorivera08
Created September 12, 2018 04:55
Show Gist options
  • Save jelorivera08/e0ea58431db3256c846287fc67da3246 to your computer and use it in GitHub Desktop.
Save jelorivera08/e0ea58431db3256c846287fc67da3246 to your computer and use it in GitHub Desktop.
// /backend/data.js
const mongoose = require("mongoose");
const Schema = mongoose.Schema;
// this will be our data base's data structure
const DataSchema = new Schema(
{
id: Number,
message: String
},
{ timestamps: true }
);
// export the new Schema so we could modify it using Node.js
module.exports = mongoose.model("Data", DataSchema);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment