Download backend/models/Note.js from grvverma/brainybytes-ai-study-smarter: direct link, hf CLI and curl.
- Browser
- Download file 672 Bytes
-
https://huggingface.co/spaces/grvverma/brainybytes-ai-study-smarter/resolve/main/backend/models/Note.js
- Command line
-
hf download hf://spaces/grvverma/brainybytes-ai-study-smarter/backend/models/Note.js
-
curl -L -o Note.js https://huggingface.co/spaces/grvverma/brainybytes-ai-study-smarter/resolve/main/backend/models/Note.js
672 Bytes
| const mongoose = require('mongoose'); | |
| const NoteSchema = new mongoose.Schema({ | |
| userId: { | |
| type: mongoose.Schema.Types.ObjectId, | |
| required: true, | |
| ref: 'User' | |
| }, | |
| flashcardId: { | |
| type: mongoose.Schema.Types.ObjectId, | |
| ref: 'Flashcard' | |
| }, | |
| title: { | |
| type: String, | |
| required: true | |
| }, | |
| content: { | |
| type: String, | |
| required: true | |
| }, | |
| tags: [String], | |
| createdAt: { | |
| type: Date, | |
| default: Date.now | |
| }, | |
| updatedAt: { | |
| type: Date, | |
| default: Date.now | |
| } | |
| }); | |
| // Indexes | |
| NoteSchema.index({ userId: 1 }); | |
| NoteSchema.index({ flashcardId: 1 }); | |
| NoteSchema.index({ tags: 1 }); | |
| module.exports = mongoose.model('Note', NoteSchema); |