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
Why json[] column type is needed? I don't think we ned this extra type - we can use same json type. To be honest I surprised why array jsons aren't supported right. Json value is going right to the underlying driver and it should be able to handle arrays of json too. Did you research if pg supports array jsons?
My workaround. @Reflect.metadata("design:type", Object)
@Entity()
export class Record {
@PrimaryGeneratedColumn()
id: number;
@Column({ type: "jsonb", nullable: true })
data: any;
@Column({ type: "jsonb", nullable: true })
@Reflect.metadata("design:type", Object)
dataset: Data[];
}
export class Data {
name: string;
}
If the metadata is not set, I get the following error.
events.js:160
throw er; // Unhandled 'error' event
^
Error: Column type of function Array() { [native code] } cannot be determined.
at Function.ColumnTypes.determineTypeFromFunction (/Users/famer.me/Repository/typeorm/build/compiled/src/metadata/types/ColumnTypes.js:9:2297)
at /Users/famer.me/Repository/typeorm/src/decorator/columns/Column.ts:35:4
at DecorateProperty (/Users/famer.me/Repository/typeorm/node_modules/reflect-metadata/Reflect.ts:1079:31)
at Object.decorate (/Users/famer.me/Repository/typeorm/node_modules/reflect-metadata/Reflect.ts:276:20)
at __decorate (/Users/famer.me/Repository/typeorm/build/compiled/test/functional/json/entity/Record.js:4:92)
at Object.<anonymous> (/Users/famer.me/Repository/typeorm/test/functional/json/entity/Record.ts:21:5)
at Module._compile (module.js:571:32)
at Object.Module._extensions..js (module.js:580:10)
at Object.Module._extensions.(anonymous function) [as .js] (/Users/famer.me/Repository/typeorm/node_modules/istanbul/lib/hook.js:109:37)
at Module.load (module.js:488:32)
npm ERR! Test failed. See above for more details.
Hi just a small doubt can I know where I can find detailed docs for Typeorm I am new to TypeOrm and I am facing difficulties in finding the detailed docs where I can find all information and every time I am depending on stack overflow for getting results instead of documentation.
Activity
dcworldwide commentedon Jan 15, 2017
Relates to #183
pleerock commentedon Jan 15, 2017
Why
json[]column type is needed? I don't think we ned this extra type - we can use samejsontype. To be honest I surprised why array jsons aren't supported right. Json value is going right to the underlying driver and it should be able to handle arrays of json too. Did you research ifpgsupports array jsons?dcworldwide commentedon Jan 16, 2017
Agree we dont need a new type. We can just re-use
jsonorjsonb.It's not mentioned explicitly, but from what i've seen people talking about in the
pgissues, inserting an array into a JSON field is supported.I need to look at how we and how
pgare handling JSON serialisation.pleerock commentedon Jan 26, 2017
btw probably @mingyang91 already fixed issue with array jsob? Take a look on this test.
mingyang91 commentedon Jan 27, 2017
My workaround.
@Reflect.metadata("design:type", Object)If the metadata is not set, I get the following error.
pleerock commentedon Jan 27, 2017
@mingyang91 its a bug. Fixed it in
0.0.8-alpha.3. I think this issue can be closed now.dcworldwide commentedon Jan 27, 2017
That's great. Just to confirm..is the reflect workaround needed?
dcworldwide commentedon Jan 27, 2017
Will this also work with json as well as jsonb?
pleerock commentedon Jan 27, 2017
no
yes
dcworldwide commentedon Feb 4, 2017
Works well, thanks
working "github issues > #204 jsonb array is not persisted correctly"
akhil0317 commentedon Apr 18, 2022
Hi just a small doubt can I know where I can find detailed docs for Typeorm I am new to TypeOrm and I am facing difficulties in finding the detailed docs where I can find all information and every time I am depending on stack overflow for getting results instead of documentation.
AlexMesser commentedon Apr 18, 2022
@akhil0317 https://typeorm.io/
akhil0317 commentedon Apr 18, 2022
Thanks for the reply in the link https://typeorm.io/
i did not find all the features documentation I am only finding the basic documentation .