You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Object literal may only specify known properties, and '$ADD' does not exist in type 'Partial<MyItem>'.
await MyTable.update({ PK }, { $ADD: { arr: [arrItem] } });
Current output and behavior (including stack trace):
/node/lib/node_modules/ts-node/src/index.ts:859
return new TSError(diagnosticText, diagnosticCodes, diagnostics);
^
TSError: ⨯ Unable to compile TypeScript:
DynamoRep.ts:43:57 - error TS2769: No overload matches this call.
Overload 1 of 18, '(obj: Partial<MyItem>, callback: CallbackType<MyItem, any>): void', gave the following error.
Argument of type '{ $ADD: { arr: string[]; }; }' is not assignable to parameter of type 'CallbackType<MyItem, any>'.
Object literal may only specify known properties, and '$ADD' does not exist in type 'CallbackType<MyItem, any>'.
Overload 2 of 18, '(keyObj: InputKey, updateObj: Partial<MyItem>): Promise<MyItem>', gave the following error.
Argument of type '{ $ADD: { arr: string[]; }; }' is not assignable to parameter of type 'Partial<MyItem>'.
Object literal may only specify known properties, and '$ADD' does not exist in type 'Partial<MyItem>'.
Overload 3 of 18, '(keyObj: ObjectType, updateObj: Partial<MyItem>): Promise<MyItem>', gave the following error.
Argument of type '{ $ADD: { arr: string[]; }; }' is not assignable to parameter of type 'Partial<MyItem>'.
Object literal may only specify known properties, and '$ADD' does not exist in type 'Partial<MyItem>'.
43 await MyTable.update({ PK }, { $ADD: { arr: [arrItem] } });
~~~~~~~~~~~~~~~~~~~~~~
at createTSError (/node/lib/node_modules/ts-node/src/index.ts:859:12)
at reportTSError (/node/lib/node_modules/ts-node/src/index.ts:863:19)
at getOutput (//node/lib/node_modules/ts-node/src/index.ts:1077:36)
at Object.compile (/node/lib/node_modules/ts-node/src/index.ts:1433:41)
at Module.m._compile (/node/lib/node_modules/ts-node/src/index.ts:1617:30)
at Module._extensions..js (node:internal/modules/cjs/loader:1308:10)
at Object.require.extensions.<computed> [as .ts] (/node/lib/node_modules/ts-node/src/index.ts:1621:12)
at Module.load (node:internal/modules/cjs/loader:1117:32)
at Function.Module._load (node:internal/modules/cjs/loader:958:12)
at Module.require (node:internal/modules/cjs/loader:1141:19) {
diagnosticCodes: [ 2769 ]
}
Expected output and behavior:
Environment:
Operating System:
Operating System Version:
Node.js version (node -v):
NPM version: (npm -v):
Dynamoose version:
Other information (if applicable):
I can remove the generic. But this creates many other problems.
Summary:
Impossible add element to array
Code sample:
Schema
Model
General
Current output and behavior (including stack trace):
Expected output and behavior:
Environment:
Operating System:
Operating System Version:
Node.js version (
node -v
):NPM version: (
npm -v
):Dynamoose version:
Other information (if applicable):
I can remove the generic. But this creates many other problems.
const MyTable = dynamoose.model('MyTable', schema, { create: false });
or
add "$ADD" to type :)
Other:
The text was updated successfully, but these errors were encountered: