mongoose icon indicating copy to clipboard operation
mongoose copied to clipboard

GeoJSON types

Open tigawanna opened this issue 9 months ago • 0 comments

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
});

tigawanna avatar Mar 23 '25 13:03 tigawanna