GeoJSON位置的猫鼬模式

时间:2019-12-05 20:21:00

标签: javascript mongodb mongoose

我希望能够使用Mongoose将设备的即时地理位置保存到Mongodb。有人可以帮我解决猫鼬模式吗?我当前的模式如下:


const User = new Schema(
    {
        userName: { type: String, required: true },
        firstName: { type: String, required: true },
        lastName: { type: String, required: true },
        primaryContact: { type: String, required: true },
        secondaryContact: { type: String, required: true },
        emergencyContact : { type: String, required: true },
        gpsLocation : //what would go in here?
    },
    { timestamps: true },
)

module.exports = mongoose.model('users', User)

谢谢!

0 个答案:

没有答案