-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
531734a
commit b878bbb
Showing
7 changed files
with
508 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
const mongoose = require('mongoose'); | ||
|
||
const Schema = mongoose.Schema; | ||
|
||
const geoSchema = new Schema({ | ||
type: { | ||
type: String, | ||
default: "Point" | ||
}, | ||
coordinates: { | ||
type: [Number], | ||
index: "2dsphere" | ||
} | ||
}); | ||
|
||
const sosSchema = new Schema({ | ||
uid: { | ||
type: String, | ||
required: true | ||
}, | ||
previous_sos: [{ | ||
date: { | ||
type: String, | ||
}, | ||
geometry: geoSchema | ||
}] | ||
}); | ||
|
||
module.exports = mongoose.model('Sos', sosSchema); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.