After previously working without any issues, my code is now encountering a type error related to the logEntry:
The following type error is occurring: Type '{ raw: string; timestamp: number; }' is not assignable to type 'Partial<ILogEntry>'.
The properties of 'constructor' within each type are incompatible.
Specifically, the type 'Function' lacks necessary properties compared to type 'Model<ILogEntry, {}>': base,
baseModelName, discriminators, modelName, and 59 other properties. (2322)
I need help on the correct implementation for this issue. Below is an example of the affected code snippet:
import { Schema, model, Model, Document } from "mongoose";
interface ILogEntry extends Document {
raw: string;
timestamp?: number;
}
const logEntry: Partial<ILogEntry> = {
raw: "hey",
timestamp: 213213,
};