I'm using TypeORM in a node javascript app. I have table users and another table user_tracks that references user.id tracks have only 2 columns user_id and track_id so I'd like to make it return an array of the ids without needing to create an Entity for tracks.
This is my entity currently:
import { EntitySchema } from "typeorm";
import { User } from "./User.js";
const UserSchema = new EntitySchema({
name: "User",
target: User,
tableName: "application_users",
columns: {
id: {
primary: true,
type: "varchar",
},
biography: {
type: "varchar",
},
country: {
type: "varchar",
},
email: {
type: "varchar",
},
image: {
type: "varchar",
},
},
});
export { UserSchema };