mongoose
mongoose copied to clipboard
GeoJSON types
Hi , loving this so far and was wondering if geo location types can be defined fo example
const polygonSchema = new mongoose.Schema({
type: {
type: String,
enum: ['Polygon'],
required: true
},
coordinates: {
type: [[[Number]]], // Array of arrays of arrays of numbers
required: true
}
});
const citySchema = new mongoose.Schema({
name: String,
location: polygonSchema
});