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
Issue type:
[ ] question [x] bug report [ ] feature request [ ] documentation issue
Database system/driver:
[ ] cordova [x] mongodb [ ] mssql [ ] mysql / mariadb [ ] oracle [ ] postgres [ ] cockroachdb [ ] sqlite [ ] sqljs [ ] react-native [ ] expo
cordova
mongodb
mssql
mysql
mariadb
oracle
postgres
cockroachdb
sqlite
sqljs
react-native
expo
TypeORM version:
[x] latest [ ] @next [ ] 0.x.x (or put your version here)
latest
@next
0.x.x
Steps to reproduce or a small repository showing the problem:
@Column('text', { transformer: { from: (value: string): BigNumber => BigNumber.from(value), to: (value: BigNumber): string => value.toString(), }, }) gasUsed!: BigNumber;
gasUsed is stored in the database as the "object", not as the result of the toString() function
The transformer code is correct because the following works correctly in Mongoose
@Prop({ get: (value: string): BigNumber => BigNumber.from(value), set: (value: BigNumber): string => value.toString() }) gasUsed!: BigNumber;
There was a very old ticket about this mentioning some commented out code, but I could not find it and at first glance, the mongodb driver should execute the transformer code here https://github.com/typeorm/typeorm/blob/master/src/driver/mongodb/MongoDriver.ts#L295-L308 triggered by
typeorm/src/query-builder/UpdateQueryBuilder.ts
Line 423 in 33041cc
The text was updated successfully, but these errors were encountered:
Duplicate of #4268
Sorry, something went wrong.
No branches or pull requests
Issue type:
[ ] question
[x] bug report
[ ] feature request
[ ] documentation issue
Database system/driver:
[ ]
cordova
[x]
mongodb
[ ]
mssql
[ ]
mysql
/mariadb
[ ]
oracle
[ ]
postgres
[ ]
cockroachdb
[ ]
sqlite
[ ]
sqljs
[ ]
react-native
[ ]
expo
TypeORM version:
[x]
latest
[ ]
@next
[ ]
0.x.x
(or put your version here)Steps to reproduce or a small repository showing the problem:
gasUsed is stored in the database as the "object", not as the result of the toString() function
The transformer code is correct because the following works correctly in Mongoose
There was a very old ticket about this mentioning some commented out code, but I could not find it and at first glance, the mongodb driver should execute the transformer code here https://github.com/typeorm/typeorm/blob/master/src/driver/mongodb/MongoDriver.ts#L295-L308 triggered by
typeorm/src/query-builder/UpdateQueryBuilder.ts
Line 423 in 33041cc
The text was updated successfully, but these errors were encountered: