Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

598
Views
NestJS/typeORM Vanilla: no se puede consultar la propiedad de muchos a muchos

Estoy usando NestJS a la manera de vanillaJS (porque no puedo escribir mecanografiado) y tengo una relación de muchos a muchos de user a bubble .

Quiero escribir una ruta de usuario de actualización en la que también quiero poder actualizar la afiliación de la bubble .

Pero cuando lo hago así: user.controller.js:

 @Patch(':id') @Bind(Param('id'), Body()) async updateUser(id, body) { if (Object.keys(body).length !== 0) { return await this.userService.updateUser(id, body); } throw new BadRequestException('Missing Body'); }

usuario.servicio.js:

 async updateUser(id, user) { return await this.userRepository.update(id, user); }

Recibo este error: Cannot query across many-to-many for property bubble

Este es mi usuario.entity.js:

 var EntitySchema = require('typeorm').EntitySchema; var User = require('./user.model').User; var Bubble = require('../bubble/bubble.model').Bubble; module.exports = new EntitySchema({ name: 'User', target: User, columns: { id: { primary: true, type: 'int', }, handle: { type: 'varchar', }, lastCheck: { type: 'datetime', default: () => 'NOW()', }, rating: { type: 'int', }, }, relations: { bubble: { type: 'many-to-many', target: 'Bubble', joinTable: true, cascade: true, }, }, });

en cartero trato de llamarlo así:

 { "rating": 10, "bubble": [{ "id": "1234" }] }

si dejo la burbuja fuera, funciona y la calificación se actualiza. con bubble me sale el error descrito arriba

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!