Created
December 4, 2019 09:29
-
-
Save haimrait/e9c48d94a37783c57d860aa85bd0f1c6 to your computer and use it in GitHub Desktop.
node-redis-mongo - Moongose model that represents a book.
This file contains hidden or 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
const mongoose = require("mongoose"); | |
const { Schema } = mongoose; | |
const bookSchema = new Schema({ | |
title: String, | |
content: String, | |
createdAt: { type: Date, default: Date.now }, | |
author: String | |
}); | |
mongoose.model("Book", bookSchema); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment