Skip to content

Commit 4a020a1

Browse files
committed
Create notes schema and model
1 parent a9f235d commit 4a020a1

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

model/notes.model.js

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import mongoose from "mongoose";
2+
3+
const noteSchema = new mongoose.Schema(
4+
{
5+
title: {
6+
type: String,
7+
require: true,
8+
},
9+
text: {
10+
type: String,
11+
require: true,
12+
},
13+
},
14+
{
15+
timestamps: true,
16+
}
17+
);
18+
19+
const Note = new mongoose.model("Note", noteSchema);
20+
21+
export default Note;

0 commit comments

Comments
 (0)