Skip to content
New issue

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

ID column not found (TypeORM & MongoDB) #9

Open
Nico205 opened this issue Nov 1, 2020 · 1 comment
Open

ID column not found (TypeORM & MongoDB) #9

Nico205 opened this issue Nov 1, 2020 · 1 comment

Comments

@Nico205
Copy link

Nico205 commented Nov 1, 2020

Hello,

this error occurs when using @adminbro/upload using @adminbro/typeorm adapter (with MongoDB database).
It's unable to determine an id column on the record and fails afterwards.

Please see the message below which refers to SoftwareBrothers/adminjs#95

Friendly Regards & Thanks
Nico


Hey,

I've got the same error using NestJS with TypeORM and Admin-Bro.

"@admin-bro/typeorm": "^1.4.0-beta.1",
"@admin-bro/upload": "^1.2.0-beta.8",
"admin-bro": "^3.3.0-beta.33",

The model looks like this:

@Entity({
  name: 'product'
})
export class Product extends BaseEntity {

  @ObjectIdColumn()
  _id: ObjectID

  @Column()
  keys: string[]

  @Column()
  imagePaths: string[]

}

The output of console.log(record.params) is:

{ '_id._bsontype': 'ObjectID',
  '_id.id': <Buffer 5f 96 bb de b7 72 6d 17 92 50 66 72> }

Adding an additional @PrimaryColumn() to the MongoDB Entity doesn't help.

Are there any news on this bug?

Friendly Regards
Nico :)

@scripterkaran
Copy link

I am also facing this, not really related to NestJS

image

    "admin-bro": "3.3.1",
    "admin-bro-expressjs": "^2.1.1",
    "admin-bro-mongoose": "^0.5.2",
    "admin-bro-sequelizejs": "^0.5.1",
    "admin-bro-typeorm": "^0.1.6-alpha.9",

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants