我希望能够使用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)
谢谢!