pengunjung.model.js 517 B

1234567891011121314151617181920212223
  1. const mongoose = require('mongoose')
  2. const user = require('./user.model')
  3. const { Schema, Types } = mongoose
  4. module.exports = mongoose.model(
  5. 'Pengunjung',
  6. new Schema(
  7. {
  8. os: { type: String },
  9. ipv4: { type: String },
  10. location: {
  11. country: { type: String },
  12. region: { type: String },
  13. city: { type: String },
  14. lat: { type: Number },
  15. lon: { type: Number },
  16. timezone: { type: String },
  17. },
  18. },
  19. { timestamps: true }
  20. ),
  21. 'pengunjung'
  22. )