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

Loopback 4 binding USER_SERVICE with a custom user service

I am trying to use my custom MyUserService which implement UserService: export class MyUserService implements UserService { ... } The difference from loopback's User, and Credentials are: MyUser.id…
Programer Beginner
  • 1,377
  • 6
  • 21
  • 47
1
vote
0 answers

/lib64/libstdc++.so.6: version `CXXABI_1.3.9' not found (required by /node_modules/snappy/build/Release/binding.node)

I am running a loopback4 project inside a docker container which runs on centos 7 version. I have installed gcc inside docker but its still giving below error due to gcc version issue as CXXABI_1.3.9 is missing in gcc@4.8 /lib64/libstdc++.so.6:…
Aman Chawla
  • 68
  • 1
  • 7
1
vote
1 answer

Loopback4 "todo" tutorial seems to be only partially working

I'm new to Loopback4 and I've just completed the "todo" tutorial, installing it exactly as documented. Some routes seem to work fine. I can add a todo item, query it by id, delete it by id, etc. But the GET /todos/count and GET /todos don't seem to…
user2943799
  • 947
  • 2
  • 13
  • 23
1
vote
1 answer

TypeError: Cannot initialize connector undefined: Cannot read property 'root' of undefined' in loopback4. How to fix it?

I'm using loopback4. I want to integrate 3rd party APIs with loopback. For that, while using loopback-connector-rest shows the error 'TypeError: Cannot initialize connector undefined: Cannot read property 'root' of undefined'. How to fix it? I have…
1
vote
1 answer

How to mock a service in acceptance test in Loopback 4

I am writing some tests in Loopback 4 and I need to mock / stub a service, I mean I need to replace it in bindings by a stub one. But I can't find how to do this. I want to write tests such as this one : it(`should work if a user was found for the…
1
vote
0 answers

Is there any option in loopback4 to use MongoDB document validation

I am using loopback4 with MongoDB. I have a counter property in my model, and would like to do atomic operation to increment/decrement that counter. My implementation now is using ExtendedOperators $inc to add or sub calculations. But I found that…
Taro
  • 11
  • 2
1
vote
0 answers

How implement nested array result with its populated detailed info in Loopback 4 and mongoDB

I wanted to store categories and its products Ids as an array in the collection. On get method I need show category info as well as product details as mentioned below .Is there any best with relational model in loopback? I am new in Loopback and…
Noufal
  • 33
  • 4
1
vote
1 answer

How to create custom decorator in loopback4?

async checkUserMemberOfProduct(userId: string, productId: string) { if (userId && productId) { const user = await Product.find({ where: { userId: userId, id: productId } }); return !!user; } return false; } I want to…
1
vote
0 answers

Connect MySQL db to Loopback4 App in docker env

I'm actually working on a loopback4 app to discover this technology and I can't figure out how to connect a local MySQL service to my app. All my env is set up via docker-compose: I currently have a mysql service to store my data, a phpmyadmin…
TIC
  • 11
  • 3
1
vote
1 answer

Parse xml request body using loopback4

I'm looking for an extension to existing body parsers.. I have a requirement to parse xml data using loopback4 node.. I have tried setting content-type to application/xml but it is giving me an unsupported content type error. xml is not supported. I…
Ravi
  • 11
  • 2
1
vote
0 answers

how to generate ERD from LoopBack model file

How can I convert LoopBack 4 models into ERD? NOTE: It doesn't matter if there is an independent tool of VSCode extension.
mbnoimi
  • 490
  • 4
  • 21
1
vote
1 answer

lb4 call another repository in different repository

What is the best way of calling different repository at the main repository? I tried to use Services. For example ... @injectable({scope: BindingScope.TRANSIENT}) export class ProjectService { constructor(@repository(ProjectRepository) public…
1
vote
1 answer

How to perform pagination in @get endpoint

In case I've huge records (millions) in my table; How can I paginate them in GET request? LoopBack 4 official control example doesn't emulate this case. I couldn't find any reference for a real case solution (they mentioned an example for the…
mbnoimi
  • 490
  • 4
  • 21
1
vote
2 answers

Facing multiple Issues while integrating opentelemetry tracing with loopback 4

I am trying to implement opentelemetry tracing in loopback 4. As per the auto instrument libraries from opentelemetry for HTTP, express, redis, psotgres all opentelemetry modules required to be loaded before any of such application module are…
user3170450
  • 375
  • 3
  • 20
1
vote
1 answer

How to define relations in dynamically created model in loopback 4

I have a requirement where the model schema will be generated by the user from a user interface that will be exposed by REST API that means dynamic models, controllers and repositories. This already has been achieved. Now the requirement is to allow…
user3170450
  • 375
  • 3
  • 20