Closes #1512 Reviewed-on: #2214 Co-authored-by: Sainan <63328889+Sainan@users.noreply.github.com> Co-committed-by: Sainan <63328889+Sainan@users.noreply.github.com>
15 lines
484 B
TypeScript
15 lines
484 B
TypeScript
import { IFissureDatabase } from "@/src/types/worldStateTypes";
|
|
import { model, Schema } from "mongoose";
|
|
|
|
const fissureSchema = new Schema<IFissureDatabase>({
|
|
Activation: Date,
|
|
Expiry: Date,
|
|
Node: String, // must be unique
|
|
Modifier: String,
|
|
Hard: Boolean
|
|
});
|
|
|
|
fissureSchema.index({ Expiry: 1 }, { expireAfterSeconds: 0 }); // With this, MongoDB will automatically delete expired entries.
|
|
|
|
export const Fissure = model<IFissureDatabase>("Fissure", fissureSchema);
|