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
0
votes
1 answer

Loopback 4 authentication error while binding custom service

I have followed this link for creating custom service for authentication in loopback 4. I successfully created the service but while binding this service in application.ts I am getting the following error. Argument of type 'typeof…
pratik jaiswal
  • 1,855
  • 9
  • 27
  • 59
0
votes
1 answer

Define a MongoDB capped collection from a Loopback 4 model

I defined a model in Loopback 4 framework as the following, and I want to specify, if possible, that the collection created in the MongoDB database is capped: import {Entity, model, property} from '@loopback/repository'; @model({ settings: { …
0
votes
1 answer

loopback 4 command model is hanging

I am using the command lb4 model but It hangs in my system(windows). My node -> 12.13.1 npm -> 6.12.1 @loopback/cli -> 2.6.0 and all dependencies are also installed correctly. Please can you tell the problem here? loopback
Adhikansh Mittal
  • 601
  • 1
  • 5
  • 13
0
votes
3 answers

Add foreign key index Loopback 4 MySQL

i am new in Loopback 4 I followed this tutorial to get started and everything worked fine. I tried to create my own models Category and SubCategory using a MySQL database, with one to many relation (one category has many sub categories), i have…
0
votes
1 answer

Loopback 4 shopping example throwing error

Hello I just downloaded lb4 shopping example stated here https://loopback.io/doc/en/lb4/Authentication-Tutorial.html#try-it-out. I have run npm install. But when I run npm run docker:start its is giving following error >…
pratik jaiswal
  • 1,855
  • 9
  • 27
  • 59
0
votes
1 answer

How to use scope in loopback filter in json format

I am trying to make call from my angular service to loopback api. I have a parcelStatuses collection that contains a parcelId so i am able to include parcel collection too but I also need to check against a particular vendorId and that vendorId…
Ehsan Nissar
  • 643
  • 2
  • 13
  • 35
0
votes
1 answer

loopback4 rest connector multiple calls

I'm using the Rest Connector in Loopback4 but how would you extend this datasource so that it has options to call more than just 1 url and have more than just 1 function? Here's my ic.datasource.config.json file: { "name": "ic", "connector":…
amazonotter
  • 61
  • 1
  • 5
0
votes
1 answer

Debugging connection PostgreSQL Loopback 4

Im on a mac(OS 10.14) using nodejs 14 and PostgresSQL 12. I just installed Loopback4 and after following this tutorial Im not able to use any of the enpoints that use Models, ie that connect to Postgres, I constantly get a timeout. It seems like its…
subharb
  • 3,374
  • 8
  • 41
  • 72
0
votes
1 answer

loopback4 Project Structure

I come from express.js background and pretty new to loopback framework, especially loopback4 which i am using for my current project. I have gone through the loopback4 documentation few times and got some good progress in setting up the project. As…
Aman Chawla
  • 68
  • 1
  • 7
0
votes
1 answer

How to call another Loopback4 Controller from another Controller?

I've read this question/answer How to call Loopback4 controller's method from another controller HOWEVER, my use case is slightly different. Unlike that answer above, I DO need my API functions to be accessible via http (and I also couldn't get even…
amazonotter
  • 61
  • 1
  • 5
0
votes
1 answer

How to trace request id in Loopback 4?

I am trying to trace each HTTP request in my REST API using Loopback 4 in order to log them in the controllers using log4js, just like this: [2020-05-05T19:21:52.191] [INFO] [request-id:47e9a486-1243-1c07-3ac0-0acc9cce2c0e] user.controller.ts -…
0
votes
0 answers

How to add a random string using a package from backend in loopback nodejs mongodb model for post method in an endpoint

So i have this endpoint created using loopback nodejs and it's post endpoint. Various fields are obtained from request itself but i want to generate a particular field containing random string from the backend itself whenever this post endpoint is…
0
votes
2 answers

loopback 4 how to use fields filter with custom scope in nested relations

I have four models- purchase, purchase products, vendors, and product. The purchase has many purchase products and vice versa purchase products belong to product and vice versa Vendors has many purchase and vice vera Now with the following code, I…
pratik jaiswal
  • 1,855
  • 9
  • 27
  • 59
0
votes
1 answer

Environment specific configuration of datasources in loopback4 application

I have just started my first loopback project and chosen loopback4 version for the application. Its purely a server application which will interact with databases (Redis and mongodb) and will call external API services due to micro-service…
Aman Chawla
  • 68
  • 1
  • 7
0
votes
1 answer

loopback 4 how to use has one get method

I have set up has one relation between two models product and product-prices. The product has one product-price and product-price belongs to the product. But I am unable to use get method that is been added to product repository after successful…
pratik jaiswal
  • 1,855
  • 9
  • 27
  • 59