Skip to content

Instantly share code, notes, and snippets.

@haimrait

haimrait/Book.js

Created Dec 4, 2019
Embed
What would you like to do?
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