Where communities thrive

  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
Repo info
  • Jan 31 2019 16:43
    uniconstructor edited #4126
  • Jan 31 2019 16:41
    uniconstructor edited #4126
  • Jan 31 2019 16:41
    uniconstructor opened #4126
  • Jan 31 2019 03:44
    dzungh0ang closed #4123
  • Jan 30 2019 00:25
    techaks closed #4125
  • Jan 30 2019 00:02
    techaks edited #4125
  • Jan 30 2019 00:01
    techaks opened #4125
  • Jan 29 2019 23:33
    jkpulido opened #4124
  • Jan 29 2019 13:32
    nabdelgadir closed #4114
  • Jan 29 2019 09:17

    bajtos on add-node10


  • Jan 29 2019 07:13
    dzungh0ang opened #4123
  • Jan 29 2019 04:25
    dhmlau closed #3881
  • Jan 28 2019 13:14
    bajtos edited #4119
  • Jan 28 2019 12:47
    bajtos labeled #4121
  • Jan 28 2019 12:46
    bajtos labeled #4118
  • Jan 28 2019 12:46
    bajtos labeled #4118
  • Jan 28 2019 12:46
    bajtos labeled #4118
  • Jan 28 2019 12:46
    bajtos assigned #4118
  • Jan 25 2019 19:50
    dhmlau closed #3906
  • Jan 25 2019 19:13
    mschnee synchronize #4119
Hudison Souza
Hi, i need some advice. Me and my team will develop some applications that will communicate with other, this application will work basically like this:
A front-end application built with react that communicates with an API. The way that this API will work is: each one of our clients will have an individual database, their users will access our front-end app, this app will locate in a Database that contains the information of, what is their enterprise and will return some connection information for them. After this, each user will have the information of what is their enterprise, and our API will take this info and connect in the database and take the data. My questions are that I don't know the best way to do this (instantiate a datasource in each request and disconnect after || after a user of enterprise x connects, I will make this connection open while are active users on that enterprise || other solution)? And I'm wrong trying to use lb4 for this scenario?
Matthew Miller
How does loopback handle mapping tables?
For example, patients and providers. Each patient could have multiple providers. Multiple patients could share providers. It’s not a strict one to many relationship. Our database has mapping tables to begin with.
I’m thinking we’ll still need to create belongsTo/hasX relations from the patient table to the mapping table and then again the mapping table to the provider table. And to get them, we’ll just have to go patientRepo.providermaps( or something?
Richard Terungwa Kombol
Hello everyone. How do you handle loggin in loopback4?
Nico Flaig
@rkterungwa16 We are using JWTs with access tokens and refresh tokens since we have a stateless microservice architecture which means there are no sessions
Richard Terungwa Kombol
@nflaig . Thanks for the response. I meant logging using winston, bunyan or any other of the logging tools.
Nico Flaig
@rkterungwa16 sorry mb for some reason I read login. We have our own solution but it is based on winston.
Abhisek Pattnaik

:question: :raising_hand: Is there any way to ignore linting while building the loopback project?

Jesus Maria Zabaleta Franco
Hello everyone
Darko Damljanović
Is there a way to link openapi specs from a separate file in order to keep controllers as clean as possible? I dont know what Im doing wrong, but it seams that even simple respose wont show as documented.
Ihar Salauyou
Hi, in loopback 4 what is the best and correct approach defining operational hooks? I have tried to add them in the model class but they are not triggered at all.
Mark Injerd
Does anyone have the mssql or email connectors working in lb4? The documentation isn't much help since it seems to be for lb3 (even though it's under lb4).
Richard Terungwa Kombol
Hi @nflaig is there a way I can see how you implemented it?
Nico Flaig
Hi @rkterungwa16 it is nothing special tbh, you can log almost all errors in sequence.ts before reject(err). For additional logging just add it where you need it. I am pretty sure how we are doing it right now is not the best solution but it works. I am not to sure what exactly you are looking for, i hope this helped.
Richard Terungwa Kombol
@nflaig this helps, thanks. However, it would be great if there was a standard loopback4 way of doing logging.
Radomir Djurdjevic
Hi everyone! Is there a way to define JSON API properties in snake case? It seems to be in camel case by default and I'm not finding any config option to change that. Help is appreciated!
Marco Strijker
Hi all, am I correct in thinking you can only have one LB4 sequence? Not several?
Richard Terungwa Kombol
Hello everyone. Is creating a validation component a bad idea? To expand further. I want to create a component that will handle validation for different api inputs. These different validation logic are going to be strategies. I don't know if this makes though. I am aware of validation for controller request body, but I need flexibility for more fine grained use cases.
Nico Flaig
Hi @rkterungwa16, in the loopback4 example shopping app they are using interceptors for input validation for example here. I have not implemented such a thing myself so I am not sure if this is the best appraoch. You might want to ask your question on stackoverflow using the #loobackjs and #loopback4 tags. It is more likely you get a good answer there.
@rkterungwa16 I just saw that interceptors can also be used for logging maybe that might be interesting for you as well
Richard Terungwa Kombol
Thanks a lot @nflaig. I will take a look at it.
Pradeep Kumar Tippa
@bajtos what are design patterns that are involved in building LB4
Darko Damljanović
Is there any way to make transaction for multiple database inserts? If there is possibility, how to implement it?
Darko Damljanović
@bajtos If we want to make transactions using multiple entities and their repositories, do we have to extend "DefaultTransactionalRepository" on every repository that is going to be a part of a transation?
Darko Damljanović
@mamiller93 Unfortunately no. Although, I was somewhat successful to separate OpenApi3 specs to another file using namespaces. I had to make RequestBody and ResponseObject separately and map them within "@operation()" decorator of a controller.
Rafaël Sarrechia
is there any documentation on how to integrate facebook authentication into Loopback4 ? #loopback4 #loobackjs
Hassan Ahmed
Hi everyone, i have a question regarding embedsOne in loopback3 relationships. Consider the example here :
it has embedsMany with scope to include and it works fine but if it's embedsOne type then the include does not work. Any idea how to fix it or workaround?
"relations": {

    "people": {

      "type": "embedsMany",

      "model": "Link",

      "scope": {

        "include": "linked"



Eduardo Mazzucchelli

hi people, how are you ??
what node component I need, for save the log in txt file, or database ??
loopback has something incluid for this ??


Edwin Zhao

Hi all, I'm trying to make some POST and GET requests to Google API, but I keep getting an unhandled error " 500 TypeError: Cannot initialize connector "rest": Cannot read property 'root' of undefined

Is this the case where my JSON file is written incorrectly?

I'm also unclear on where Google AUTH key would go into the JSON file here
Edwin Zhao
This error seems to appear when I have a parameter in a function call for any request. What would be the correct formatting?


  //ts-lint:disable-next-line: no-any
  async getDetails(): Promise<any> {
    return await this.apiService.getDetails('authToken');

api.service.ts > interface
getDetails(apiKey: string): Promise<any>;


"operations": [{
    "template": {
      "method": "GET",
      "url": ""
    "functions": {
      "getDetails": ["authToken"]
This is somewhat what the code looks like. appreciate any help!
Hi Guys

I have an user model which has following relation with address table .

@hasMany(() => UserAddress) addresses?: UserAddress[];

But in api explorer , its not showing any fields for entering address details for user controller .

Any suggestions on above will be greatly appreciated
Nico Flaig
@lakinmohapatra it is a relation not part of the user model itself. Take a look at the docs
Pradeep Kumar Tippa

In LoopBack 4, What is the right place to perform data transformation, Ex: converting all the snake case keys coming from datasource to camel case sending as REST response.?

@bajtos @dhmlau

Taskhyn Maksim
how to use LoopBack 4 without typescript but just with ES06?
Darko Damljanović
@pktippa You need to confirm this, but Sequence or Interceptors sounds good. I think they act as a replacement for good old Express Middlewares we have been use to 😊
@bajtos Are there any words regarding postgresql support for foreign keys in either model or property decorator? We now have weak links, but we cannot use ER diagram to inspect database relationship at this point.
hi guys i have getting this error when using lb4 with mongodb:
"error": {
"statusCode": 422,
"name": "UnprocessableEntityError",
"message": "The request body is invalid. See error object details property for more info.",
"details": [
"path": "",
"code": "not",
"message": "should NOT be valid",
"info": {}
with memory DB there is no issue but when adding MongoDB post API is making issue as I post above.
Warman Suganda
hi, how to defining custom keywords? i need add AJV keyword for Asynchronous validation in some controllers.
Ahmad Ali
hello any example how to make live location in lp4 ?