location update optimized with schema changes and geoJson Compatability testing endpoint with encrypted key authorization

This commit is contained in:
Shibi Chakkaravarthy
2026-04-17 14:15:11 +05:30
parent b44abf9c88
commit 92769cfd38
19 changed files with 459 additions and 27 deletions
+20 -1
View File
@@ -1,5 +1,24 @@
import { model, Schema, Types } from "mongoose";
import { locationSchema } from "../../helpers";
const schema = new Schema({});
const schema = new Schema({
user: {
type: Types.ObjectId,
required: true,
ref: "user",
},
coordinates: locationSchema,
createdOn: {
type: Date,
required: true,
},
venue: {
type: Types.ObjectId,
required: false,
ref: "venue",
},
});
schema.index({ coordinates: "2dsphere" });
export default model("location", schema);