Skip to content

Instantly share code, notes, and snippets.

@BDOMDev
Last active October 9, 2019 10:07
Show Gist options
  • Save BDOMDev/092c826f28dc26923f0b322141ccd485 to your computer and use it in GitHub Desktop.
Save BDOMDev/092c826f28dc26923f0b322141ccd485 to your computer and use it in GitHub Desktop.
const geoSchema = new Schema({
type: {
type: String,
default: 'Point'
},
coordinates: {
type: [Number]
}
});
var VehicleSchema = new Schema(
{
location: {
type: geoSchema,
index: '2dsphere'
},
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment