We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I have this entity UserEntity:
import { Attribute, AutoGenerateAttribute, Entity, INDEX_TYPE, AUTO_GENERATE_ATTRIBUTE_STRATEGY, } from "@typedorm/common"; @Entity({ name: "users", primaryKey: { partitionKey: "USER#{{id}}", sortKey: "USER#{{id}}", }, indexes: { GSI1: { partitionKey: "USER#{{email}}", sortKey: "USER#PHONE#{{phone}}#EMAIL#{{email}}", type: INDEX_TYPE.GSI, }, GSI2: { partitionKey: "USER#{{phone}}", sortKey: "USER#EMAIL#{{email}}#PHONE#{{phone}}", type: INDEX_TYPE.GSI, }, LSI1: { sortKey: "USER#UPDATED_AT#{{updatedAt}}", type: INDEX_TYPE.LSI, }, }, }) export class UserEntity { @AutoGenerateAttribute({ strategy: AUTO_GENERATE_ATTRIBUTE_STRATEGY.UUID4, }) id: string; @Attribute() name: string; @Attribute() lastName: string; @Attribute({ unique: true, }) email: string; @Attribute({ unique: true, }) phone: string; @Attribute() externalKey: string; @Attribute() paymentGatewayKey?: string; @Attribute() cards?: string[]; @AutoGenerateAttribute({ strategy: AUTO_GENERATE_ATTRIBUTE_STRATEGY.EPOCH_DATE, }) createdAt: number; @AutoGenerateAttribute({ strategy: AUTO_GENERATE_ATTRIBUTE_STRATEGY.EPOCH_DATE, autoUpdate: true, }) updatedAt: number; }
I tried to update using this query:
getEntityManager().update(UserEntity, { id }, { name: 'John', lastName: 'Doe', email: 'john@doe.com' phone: '123456789', })
But I got this message:
{ "errorType": "TypeError", "errorMessage": "Cannot read properties of undefined (reading 'map')", "code": "TypeError", "message": "Cannot read properties of undefined (reading 'map')", "time": "2023-06-07T03:35:14.889Z", "stack": [ "TypeError: Cannot read properties of undefined (reading 'map')", " at Response.<anonymous> (/var/task/node_modules/@typedorm/document-client/cjs/src/classes/document-client-v2.js:97:57)", " at Request.<anonymous> (/var/task/node_modules/aws-sdk/lib/request.js:367:18)", " at Request.callListeners (/var/task/node_modules/aws-sdk/lib/sequential_executor.js:106:20)", " at Request.emit (/var/task/node_modules/aws-sdk/lib/sequential_executor.js:78:10)", " at Request.emit (/var/task/node_modules/aws-sdk/lib/request.js:686:14)", " at Request.transition (/var/task/node_modules/aws-sdk/lib/request.js:22:10)", " at AcceptorStateMachine.runTo (/var/task/node_modules/aws-sdk/lib/state_machine.js:14:12)", " at /var/task/node_modules/aws-sdk/lib/state_machine.js:26:10", " at Request.<anonymous> (/var/task/node_modules/aws-sdk/lib/request.js:38:9)", " at Request.<anonymous> (/var/task/node_modules/aws-sdk/lib/request.js:688:12)" ] }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I have this entity UserEntity:
I tried to update using this query:
But I got this message:
The text was updated successfully, but these errors were encountered: