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

135
Views
Intentando agregar un esquema json de dependencia usando loopback mongodb

Quería un esquema de dependencia usando mongodb loopback. Mis solicitudes de publicación:

SOLICITUD TIPO 1

 { “url”: “google.com” “type”: “redirect” }

SOLICITUD TIPO 2

 { “url”: “yahoo.com” “type”: “anchor” }

Mi función modelo se parece a

 @property({ type: 'string', required: true, }) type: string; @property({ type: 'string', required: true, jsonSchema: { maxLength: 2000, pattern: '^[\\]*$', //using some regex }, }) url: string;

Mi problema es que quiero que este patrón de URL se verifique solo si el tipo de carga útil es redirigir. Leí sobre las dependencias del esquema json. Pero no está funcionando. Tampoco dando ningún error. Estoy intentando algo como:

 @property({ type: 'string', required: true, jsonSchema: { maxLength: 2000, "dependencies": { if(type == “redirect){ pattern: '^[\\]*$', //using some regex } } }, }) url: string;
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!