Questions tagged [loopback4]

Questions about LoopBack version 4. Use this tag for LoopBack questions which are specific to only version 4. General LoopBack questions should be tagged with loopbackjs.

Create powerful APIs easily with a new creation experience for defining REST APIs and handling API requests/responses.

A new, improved programming model with dependency injection and new concepts such as components, mixins, repositories, etc. make this the most extensible version yet.

See also

483 questions
1
vote
1 answer

db migration User entity in Loopback4

I follwed Loopback 4 tutorial to secure Api with @loopback/authentication, @loopback/authentication-jwt. I created a entity todo to follow tutorial example, when I migrate db only todo table is created but User, UserCredential related Tables can't…
Muhammad Azam
  • 535
  • 7
  • 12
1
vote
1 answer

My Loopback 4 model has an id of type string but it reports as number in /explorer

Loopback 4 MongoDB v4.2.3 I'm teaching myself Loopback 4 and I have a problem in handling id. Even though I have my model id type set to string it reports it's of type number in /explorer. My goal is to use mongodb generated ids but this is…
chris loughnane
  • 2,648
  • 4
  • 33
  • 54
1
vote
1 answer

Loopback 4 openapi nswag make filter optional and get type

I'm facing the issue that the Loopback 4 filter that is created on the generated endpoints is marked as required in my Nswag typescript generated file. This needs to be optional. But i can't find where it's coming from. The endpoint from my…
RMCS
  • 383
  • 3
  • 17
1
vote
2 answers

Inner join not available in loopback 4

Associations are properly set & code is working but I am struggling with join type I want. Below code is written to get only those addresses which have users having ids [260, 123]. const addresses = await this.addressRepository.find({ include: [{ …
ray
  • 5,454
  • 1
  • 18
  • 40
1
vote
1 answer

Get Associated Data For LoopBack 4

I have User & Address tables & models, for users I have ids [23, 45, 54] & I want to fetch Addresses for those users. What will be best practice to fetch data? I was trying somewhat like, userRepository.find({ where: [23, 45, 54], includes:…
ray
  • 5,454
  • 1
  • 18
  • 40
1
vote
1 answer

My generate files from lb4 openapi cli command doesn't find models folder

My OpenAPI api json files are in ./reference and refer to models in the ./reference/models folder - so when I attempt to generate controllers/models from the API files, it says it can't find the ./models (not ./reference/models) folder. Is there a…
Manchuwook
  • 341
  • 3
  • 15
1
vote
2 answers

How to stream a media file from server to client side for example an mp3 audio file in my case in loopback 4 nodejs?

I have loopback 4 - nodejs in the backend and Ionic 4 in the frontend of my mobile application. I'm storing an mp3 file on server sid and I want to stream and play it on the client-side so basically audio streaming from loopback4. So basically I'm…
1
vote
0 answers

Loopback 4 served static files not showing on kubernetes

everyone. Have been banging my head against this for a while, and maybe someone else has a better idea of what my issue is. I have a react and lb4 application and I want to host it on our kubernetes cluster. I build the react project and put it into…
Keanu
  • 207
  • 2
  • 3
  • 9
1
vote
1 answer

LB4 - HasManyThrough Support via CLI or in general?

It seems the HasManyThrough has not been implemented in LB4 ? Its certainly not available via the CLI command lb4 relation. Is that really so or is there is there a non-CLI alternative ? https://loopback.io/doc/en/lb3/HasManyThrough-relations.html
1
vote
1 answer

How can I protect the loopback explorer by username and password?

I've just started using loopback4 and I would like to protect the /explorer from being public. The user would initially see a page where username and password must be entered. If successful, the user is redirected to /explorer where he can see all…
1
vote
1 answer

loopback 4 : How to implement many to many relationship?

I'm trying to implement many to many relationship in loopback using hasManyThrough , however in official documentation I'm unable to find any information regarding it . After researching a bit I have followed this. and unable to achieve desired data…
1
vote
1 answer

Loopback4 modifies filter parameter in repository 'findById' operation

I'm trying here before going to create an issue as it might be simply my comprehension of how to use filters in LB4. I'm using postgresql as a database within a lb4 application. I made my controller, my models, and added the logic. I want my models…
Sami Tahri
  • 1,077
  • 9
  • 19
1
vote
1 answer

Loopback hasMany relation is not returning data

I'm using loopback 4 and loopback cli version is 2.2.1 and I'm using MongoDB connector as my data-source, When I try to filter data using API explorer I'm unable to fetch order details , hasMany relation is not working as expected but in order query…
1
vote
1 answer

Adding a service to a loopback4 app and service class methods not working on controller endpoints

I'm implementing an SMS service in a loopback4 application. I have my service class which has one method, but when I try calling it in a controller endpoint, after injecting the dependency and binding the service to the application, I get an error…
SergioGaitan
  • 286
  • 3
  • 11
1
vote
1 answer

Getting "unauthorized" in IBM Cloudant http loging?

I have created a IBM Cloudant DB and trying to connect via Legacy HTTP Cookie based authentication, which fails with 401 code. Why this fails, as I followed every step correctly ? Request: url: 'https://.cloudant.com/_session', …
Milind Singh
  • 296
  • 6
  • 23