Skip to content

Exception getIdProperty ? #387

@facundopoblete

Description

@facundopoblete

I'm using objection & MSSQL.
My model (ClassA) is something like this:

import { Model } from 'objection';

export class ClassA extends Model {

	public constructor(init?: Partial<ClassA>) {
		super();
		Object.assign(this, init);
	}

	static get tableName() {
		return 'ClassA';
	}

	public Name? : string = undefined;
}

And for the objection query I defined my where clause in a var objectClassA.

let objectClassA: ClassA = new ClassA({
	Name: "name"
});

return await ClassA.query().where(objectClassA).first();

But this throws a exception: "TypeError: model.constructor.getIdProperty is not a function."

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions