Created
September 12, 2018 04:55
-
-
Save jelorivera08/e0ea58431db3256c846287fc67da3246 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// /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