oramap/backend/models/Family.js
dvirlabs 02074aa4a6
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
Add MongoDB integration with CRUD UI
- Integrated MongoDB 7.0 with Mongoose ODM
- Added CRUD API endpoints (GET, POST, PUT, DELETE)
- Created Family model with validation
- Added database seeding script with initial data
- Implemented Add Family modal form in frontend
- Updated docker-compose with MongoDB service
- Updated Helm chart to v0.3.0 with MongoDB StatefulSet
- Updated documentation with MongoDB setup instructions
2026-03-25 01:51:46 +02:00

34 lines
547 B
JavaScript

const mongoose = require('mongoose');
const familySchema = new mongoose.Schema({
family: {
type: String,
required: true,
trim: true
},
city: {
type: String,
required: true,
trim: true
},
lat: {
type: Number,
required: true,
min: -90,
max: 90
},
lng: {
type: Number,
required: true,
min: -180,
max: 180
}
}, {
timestamps: true
});
// Index for faster searches
familySchema.index({ family: 'text', city: 'text' });
module.exports = mongoose.model('Family', familySchema);