Skip to content

Instantly share code, notes, and snippets.

@haimrait
Created December 4, 2019 09:29
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save haimrait/e9c48d94a37783c57d860aa85bd0f1c6 to your computer and use it in GitHub Desktop.
node-redis-mongo - Moongose model that represents a book.
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