forked from MyZubster-Ecosystem/myzubster
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAnimal.js
More file actions
54 lines (52 loc) 路 842 Bytes
/
Copy pathAnimal.js
File metadata and controls
54 lines (52 loc) 路 842 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
const mongoose = require('mongoose');
const AnimalSchema = new mongoose.Schema({
name: {
type: String,
required: true,
trim: true
},
species: {
type: String,
required: true,
trim: true
},
breed: {
type: String,
trim: true
},
age: {
type: Number,
min: 0
},
owner: {
type: String,
required: true,
trim: true
},
ownerEmail: {
type: String,
trim: true,
lowercase: true
},
registeredBy: {
type: mongoose.Schema.Types.ObjectId,
ref: 'User',
required: true
},
location: {
lat: { type: Number },
lng: { type: Number }
},
verified: {
type: Boolean,
default: false
},
imageUrl: {
type: String
},
createdAt: {
type: Date,
default: Date.now
}
});
module.exports = mongoose.model('Animal', AnimalSchema);