Я создал модель и хочу сохранить ее в моем компасе mongoDB.
const BootcampSchema = new mon goose .Schema ({
location:{
// GeoJSON Point
type: {
type: String,
enum: ['Point'],
required: true
},
coordinates: {
type: [Number],
required: true,
index: '2dsphere',
sparse: true,
},
formattedAddress: String,
street: String,
city: String,
state: String,
zipcode: String,
country: String
});
Нажмите