我目前正在使用 NestJS 设置 Objection.js,但在使用任何类型的图形获取或保存方法时遇到问题。相关型号:
import { BaseModel } from './base.model';
import { Model } from 'objection';
import { ResourceGroupTypeModel } from './resource-group-type.model';
import { CollectionModel } from './collection.model';
import { AttributeModel } from './attribute.model';
import { ResourceModel } from './resource.model';
export class ResourceGroupModel extends BaseModel {
static tableName = 'resource_group';
typeId: number;
title: string;
groupId: string;
collectionId?: number;
defaultResourceId?: number;
isDeleted: boolean;
static relationMappings = {
attributes: {
modelClass: AttributeModel,
relation: Model.ManyToManyRelation,
join: {
from: 'resource_group.id',
through: {
from: …Run Code Online (Sandbox Code Playgroud)