hi so i i am getting the follow error for the follow function:
function:
await AutoUsersPositions.updateOne(
{ user: userSetup.userEmail },
{ $push: { stocks: { id: position._id, active: true, createdAt: Date.now()} } }
)
errors:
Type 'any' is not assignable to type 'never'.
Type 'boolean' is not assignable to type 'never'.
Type 'number' is not assignable to type 'never'.
the first error is assigned to the word "id" the 2nd is to "active" and the 3rd one is to "createdAt"
my interface to this collection:
const AutoUsersPositionSchema = new Schema({ //סכמה משתמש
user: String,
userID: String,
stocks: Array,
bonds: Array,
comodity: Array,
currencyPairs: Array,
indexes: Array,
}, { collection: "AutoUsersPositions"} );
export interface AutoUsersPositionsDocument extends Document {
user?: string,
userID?: string,
stocks?: [id: any, active: any, createdAt: any],
bonds?: [id: any, active: any, createdAt: any],
comodity?: [id: any, active: any, createdAt: any],
currencyPairs?: [id: any, active: any, createdAt: any],
indexes?: [id: any, active: any, createdAt: any],
id? : any,
active?: any,
createdAt: any,
[key: string]: any
}
apprenatly the problem started happening after i added [key:string]: any (i dont want to delete this). any ideas how to fix this?