Commit 4e617ff7 authored by jjaouen's avatar jjaouen
Browse files

Merge branch 'feature/model' of labs.pixelswap.fr:Avis-de-Template/server into feature/model

parents c6415697 cb54cf24
var mongoose = require('mongoose');
const Schema = mongoose.Schema;
const ObjectId = Schema.ObjectId;
const campSchema = new Schema({
_id: ObjectId,
location:
{
lat: {
type: Number,
required: true
},
lon: {
type: Number,
required: true
},
alt: {
type: Number,
required: true
}
},
name: String,
logs: [{type: ObjectId, ref: 'Log'}],
resources: [{type: ObjectId, ref: 'Resource'}],
});
var Camp = mongoose.model('Camp', campSchema);
var mongoose = require('mongoose');
const Schema = mongoose.Schema;
const ObjectId = Schema.ObjectId;
const resourceSchema = new Schema({
_id: ObjectId,
type: String,
quantity: Number,
unit: String,
});
var Resource = mongoose.model('Resource', resourceSchema);
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment