From 48e39615b43e740218230527142f35d2aa4b3b2e Mon Sep 17 00:00:00 2001 From: Kasey Liu <55379287+kaseyliu@users.noreply.github.com> Date: Fri, 31 Jan 2025 07:01:35 +0800 Subject: [PATCH] edit tree schema type --- package-lock.json | 15 +++++++++++++++ src/database/treeSchema.ts | 12 ++++++------ 2 files changed, 21 insertions(+), 6 deletions(-) diff --git a/package-lock.json b/package-lock.json index a5938b2..9ec4e36 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7261,6 +7261,21 @@ "funding": { "url": "https://github.com/sponsors/sindresorhus" } + }, + "node_modules/@next/swc-win32-ia32-msvc": { + "version": "14.2.23", + "resolved": "https://registry.npmjs.org/@next/swc-win32-ia32-msvc/-/swc-win32-ia32-msvc-14.2.23.tgz", + "integrity": "sha512-zfHZOGguFCqAJ7zldTKg4tJHPJyJCOFhpoJcVxKL9BSUHScVDnMdDuOU1zPPGdOzr/GWxbhYTjyiEgLEpAoFPA==", + "cpu": [ + "ia32" + ], + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10" + } } } } diff --git a/src/database/treeSchema.ts b/src/database/treeSchema.ts index e694002..7d3b403 100644 --- a/src/database/treeSchema.ts +++ b/src/database/treeSchema.ts @@ -3,20 +3,20 @@ import mongoose, { Decimal128, Schema } from "mongoose"; export type ITree = { _id: string; collectorName: string; - dateCollected: string; - gpsCoordinates: string; - photo: string; + dateCollected: Date; + gpsCoordinates: Decimal128[]; + photo?: string; dbh: Decimal128; canopyBreadth: Decimal128; species: string; treeCondition: string[]; - additionalNotes: string; + additionalNotes?: string; }; const TreeSchema = new Schema({ collectorName: { type: String, required: true }, - dateCollected: { type: String, required: true }, - gpsCoordinates: { type: String, required: true }, + dateCollected: { type: Date, required: true }, + gpsCoordinates: { type: [mongoose.Types.Decimal128], required: true }, photo: { type: String, required: false }, dbh: { type: mongoose.Types.Decimal128, required: true }, canopyBreadth: { type: mongoose.Types.Decimal128, required: true },