Skip to content

Instantly share code, notes, and snippets.

@popeating
Created November 3, 2023 10:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save popeating/40c73cddac0ed57ace74cd6623d9f66d to your computer and use it in GitHub Desktop.
Save popeating/40c73cddac0ed57ace74cd6623d9f66d to your computer and use it in GitHub Desktop.
import mongoose from 'mongoose';
const contactSchema = new mongoose.Schema(
{
name: { type: String, required: true },
email: { type: String, required: true },
},
{ timestamps: true }
);
const Contact =
mongoose.models.Contact || mongoose.model('Contact', contactSchema);
export default Contact;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment