Where communities thrive


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

    bajtos on add-node10

    (compare)

  • Jan 29 07:13
    dzungh0ang opened #4123
  • Jan 29 04:25
    dhmlau closed #3881
  • Jan 28 13:14
    bajtos edited #4119
  • Jan 28 12:47
    bajtos labeled #4121
  • Jan 28 12:46
    bajtos labeled #4118
  • Jan 28 12:46
    bajtos labeled #4118
  • Jan 28 12:46
    bajtos labeled #4118
  • Jan 28 12:46
    bajtos assigned #4118
  • Jan 25 19:50
    dhmlau closed #3906
  • Jan 25 19:13
    mschnee synchronize #4119
Eduardo Mazzucchelli
@emazzu

hi people, do you know about this error ???

"name": "wellnotes",
"options": {
"idInjection": false,
"mssql": {
"schema": "dbo",
"table": "wellNotes"
}
},
"properties": {
"id": {
"type": "Number",
"required": true,
"length": null,
"precision": 10,
"scale": 0,
"id": 1,
"mssql": {

"error": {
"statusCode": 404,
"name": "Error",
"message": "Unknown \"wellnotes\" id \"undefined\".",
"status": 404,
"code": "MODEL_NOT_FOUND",
"stack": "Error: Unknown \"wellnotes\" id \"undefined\".\n at new Error (native)\n at Function.convertNullToNotFoundError

sertal70
@sertal70
Hi all, I'm working with lb4 and I need to use the MongoDB $unsetextended operator. Documentation on MongoDB connector indirectly states that they can be used (see here) , but I can't find any example on how should I use them on my repository, do you have any hints?
Eduardo Mazzucchelli
@emazzu

hi people, how are you ?

what can be, the relations propoeties works with BelongsTo, but not with hasMany

"relations": {
"cat": {
"type": "hasMany",
"model": "wnCategories",
"foreignKey": "idCategory",
"primaryKey": "id"
},
"ss": {
"type": "hasMany",
"model": "wnStatusSituations",
"foreignKey": "idSituationStatus",
"primaryKey": "id"
}
}

with hasMany, says:
"originalError": {
"info": {
"number": 207,
"state": 1,
"class": 16,
"message": "Invalid column name 'idCategory'.",
"serverName": "sqlaas01d-e1-sinopecarg",
"procName": "",
"lineNumber": 1,
"name": "ERROR",
"event": "errorMessage"
}
},

the category, exists.

"idCategory": {
"type": "Number",
"required": true,
"length": null,
"precision": 10,
"scale": 0,
"mssql": {
"columnName": "idCategory",
"dataType": "int",
"dataLength": null,
"dataPrecision": 10,
"dataScale": 0,
"nullable": "NO"
}
},

Asjad ® 🤷🏻‍♂️
@ChAsjadMahmood3_twitter
Hi , usually when you create model it maps exactly in the postgresql. but when i use relations in lb4 i.e @hasmany etc it has no effect on postgresql database sql. Even when i create arrays in lb4 as proposed in the docs no changes happen in the sql when i see it in pgadmin.
secondly is their any way you can use sql complex queries like( group by queries ) to work in lb4
William Ondenge
@wondenge
{ "cardAcceptor": { "address": { "city": "Foster City", "country": "RU", "county": "San Mateo", "state": "CA", "zipCode": "94404" }, "idCode": "ABCD1234ABCD123", "name": "ABCD", "terminalId": "ABCD1234" }, "destinationCurrencyCode": "840", "markUpRate": "1", "retrievalReferenceNumber": "201010101031", "sourceAmount": "100", "sourceCurrencyCode": "643", "systemsTraceAuditNumber": "350421" }

{ "cardAcceptor": { "address": { "city": "Foster City", "country": "RU", "county": "San Mateo", "state": "CA", "zipCode": "94404" }, "idCode": "ABCD1234ABCD123", "name": "ABCD", "terminalId": "ABCD1234" }, "destinationCurrencyCode": "840", "markUpRate": "1", "retrievalReferenceNumber": "201010101031", "sourceAmount": "100", "sourceCurrencyCode": "643", "systemsTraceAuditNumber": "350421" }

Any advice how I can represent this using an lb4 model command on the cli? Or other workarounds with nested objects. Thanks

Scott Switzer
@switzer
Hi! I am trying to create a SOAP request with the following format: {parentnode: childnode: {$attributes: {ID: 1}, childnode{$attributes: {ID: 2}}
The resulting SOAP request only includes the last childnode - e.g. looks like since both child nodes are named the same thing, the second one overwrites the first.
I tried to put the child nodes into an array, but that does not work either
Does anyone have advice for me? I looked through all of the tests, and this case does not seem to be covered
BTW - using the strong-soap Node module
Scott Switzer
@switzer
Um - sorted it out. {parent node: childnode: [a,b]}
Diana Lau
@dhmlau
@wondenge , when creating the cardAcceptor model, you can specify type "object" as address. In the generated typescript class, you can:
@property()
address?: Address;
Francisco Buceta
@frbuceta
Hey, how are you?
Can you help me? How can I execute a stored procedure and map it with a model?
Eduardo Mazzucchelli
@emazzu
hi people,
how can i to do, a query for get relation to idAction and idRecource ???
I have defined it !!!
image.png
Irnel Victoria Sosa
@irnelfcb_twitter
Why does the many-to-many relationship not appear in the official LB4 documentation? @raymondfeng @bajtos https://loopback.io/doc/en/lb4/Relations.html
Petro Darii
@pdarii

Hi, maybe anybody can help me?
I'm on loopback 4, I'm have two related tables, table A belongs to table B. I'm deleting row from table B, and need that corresponding row from table A become deleted too.
I use "cascade" option, but receiving error :

Unhandled error in DELETE /api/skill-criteria/f586baf7-11fd-4a27-bd53-3bafb29b80c2: 500 error: update or delete on table "skillcriteria" violates foreign key constraint "userskillcriteria_skill_criteria_id_fk" on table "userskillcriteria"

Any ideas?
Thanks

DanielJaramillo94
@DanielJaramillo94

Hi, can please somebody patiently gide me trough the process of deploying a Loopback app into an Apache Server? For example, I try to run 'npm run build' to get the folder with the production code, but it doesn't seem to work, but I expected it, because I am not having any environment files in my app. I read the docs, and it says:

"By default, a LoopBack application created with the application generator has two kinds of configuration files in the server directory that you use to configure production settings..."

But when I create a project, I cannot find these two files anywhere.

Any help is appreciated.

DanielJaramillo94
@DanielJaramillo94
Also, can you explain me please why a 'dist' folder is containing the test folder?
DanielJaramillo94
@DanielJaramillo94
I will explain better what is my problem.
I am working with LoopBack and MySQL for the database, and is happening that in my development environment I am not having any issues, but in the server, that have installed PM2 for handling the Node processes, it is happening that when I retrieve a timestamp value, I am getting a JSON with the time BUT it have 5 hours less than time in datase. I live in a country with GMT-5, so I guess that's the reason for subtracting 5 hours. The thing is that the server is running directly my developing code, just with changes in the datasource.json file so the connection with the production database can be done properly. My boss sugest me to make a build process for the code (as we do in the Vue project —we're working the front with Vue—) and just use that code in the production environment; so that is why I'm consulting how to do that production dist folder.
manjunaths222
@manjunaths222
Hi ppl.
I have a use case where I need to call the "Third Party API" during the startup of the Loopback4 based server. Is there any way to do that? i.e. any way to call the other REST API during the booting of the loopback4?
Nico Flaig
@nflaig
@DanielJaramillo94 your time problem can be easily solved by using unix timestamps.
mflanagan
@mflanagan
I'm implementing a new app/REST API from scratch. Our team is familiar/comfortable with nest.js and passport.js (we’ve used both in previous successful application rollouts; we want to use passport for our own custom authentication as well as 3rd-party auth). We’re considering using LoopbackJS instead of nest.js, but we’re concerned about its ability to tie in to passport.js. I’ve seen the example/tutorial with loopback3, but that’s conspicuously absent in the loopback4 documentation. Is the only authentication available in loopback4 the @loopback/authentication package? Any thoughts on integrating lb4 with passport (as we do with nest.js)?
Shawn Iwinski
@siwinski
Hello all -- Is there any documentation or tutorial available for how to create a custom LoopBack 4 connector? -- v2 has https://loopback.io/doc/en/lb2/Building-a-connector.html but i cannot seem to find the equivalent for v4
DanielJaramillo94
@DanielJaramillo94
@nflaig thanks for your sugestion.
Anyways, I would like to know how to make the deploy in the Apache Server and get the answers for the things I mentioned. I really would like to learn LoopBack, I think is a great framework, but is lacking in documentation or I'm dumb.
Munyasi
@Munyasi
How can I update my base-models (Role, RoleMapping, ACL) id to use uuids as opposed to auto-increment keys
Munyasi
@Munyasi
I eventually managed to solve this by creating a custom model with similar base name but using lowercase letters then extended the base model
Vishnuvardhan
@Vsnuv_twitter
does loopback 3 supports where filter with skip + limit?
Olivier Ballerini-Gendrin
@wBatdeveloppement4
@Vsnuv_twitter : yes, it does. https://loopback.io/doc/en/lb3/Skip-filter.html
Olivier Ballerini-Gendrin
@wBatdeveloppement4

hi people, do you know about this error ???

"name": "wellnotes",

"error": {
"code": "MODEL_NOT_FOUND"

Try naming your model “wellnote”?

Hi everyone, I’m Olivier, from wBat, France.
We are working on a product designed to help companies working in construction (houses, buildings…).
This message was deleted
Olivier Ballerini-Gendrin
@wBatdeveloppement4

We have a multi-tenant architecture, i.e. each company has it’s own mysql database.
And we have issues in guaranteeing that the data goes into the right database on concurrent requests.
Because we use attachTo on the models in a middleware before request execution.
So simultaneous requests cause simultaneous attachTo to be performed on the models, resulting in one wrong database for one of the request.
We tried to clone our models for our users (ie invoice becomes invoice42 for org 42 throug createModel + base model), but this leads to two issues :

  • a timeout because we have 60+ models to clone;
  • an issue with the clonning of the relations. How can we do it in a createModel situation ?

Every clue is welcome.

Frederic Lang
@fredlnl

Hi, everyone
I am currently doing the todo tutorial with @loopback/cli version 1.21.6
I appears that the turorial has been made with a previous version of loopback cli. When I write the todo model, I get

? Enter the property name: id
? Property type: number
? Is id the ID property? Yes
? Is it required?: No
? Is id generated automatically? No
? Default value [leave blank for none]:

Can you explain the line "is the id generated automatically ?" ? I guess it does mean that if the id is not specified in the request, it is generated by loopback. Nevertheless, I believe loopback does generate an id even if this field is set to "No".
Thank you in advance,
Frederic

Nico Flaig
@nflaig
@fredlnl the id will be generated by your datasource for example mongodb would generate an ObjectId like this 5d7f57d080c2ae1ea4fadec9. I am not sure what happens when you use in-memory datasource
XiaoMLoveClassic
@XiaoMLoveClassic
Hi, everyone, I have got garbled characters when the data in dashdb is not English language, is it a defect of the connector I am using( loopback-connector-dashdb)? for the data can be showed as normal if I use jdbc to connect the dashdb, and retrieve the data.
how can I upload images here?
sestienne
@sestienne
Hi, i'm trying to use graphQL, I followed this doc https://loopback.io/doc/en/lb4/exposing-graphql-apis.html but when I run npx openapi-to-graphql http://localhost:3000/openapi.json I've got the following error message : OpenAPI-to-GraphQL creation event error: OpenAPI-to-GraphQL currently cannot handle 'not' keyword in '{"title":"TodoOptional[todoListId]Excluding[id]","not":{"anyOf":[{"required":["id"]}]},"properties":{"title":{"type":"string"},"desc":{"type":"string"},"isComplete":{"type":"boolean"},"todoListId":{"type":"number"}},"required":["title"]}'
(node:18320) UnhandledPromiseRejectionWarning: AssertionError: component name invalid. Somebody is able to help me ?
sanketthecoder
@sanketthecoder
A Quick question about implementing Microservices using loopback. As generally suggested the microservices should be loosely coupled. Then can anyone please explain how will the "relations" concept work in loopback keeping the above statement in mind. A)Should each microservice be built as a separate loopback application or
B)The models in a single loopback application should be considered as a microservice [But then would it hold the microservices properties? Individual Scaling etc]
DanielJaramillo94
@DanielJaramillo94

When I do npm run build in Vue.js, the framework creates a dist folder that I can place in the htdocs of Xampp and then just open the project from localhost/vueApp.

I've been trying to also run npm run build in the LoopBack project, but the files generated cannot be runned by Apache because there is no .html file created in the dist folder; that makes sense for me, because this project is an API, not a web page.

The question is, can I run the LoopBack API from Apache? If yes, how?

Vishnuvardhan
@Vsnuv_twitter
@wBatdeveloppement4
@wBatdeveloppement4 when I apply where and I am not able to apply skip. E.g. I have car database and in car catalog page I want to apply Brand=BMW and apply skip and limit. My results are huge in certain scenarios, and results contains high resolution images. So skip and limit are absolutely necessary on the where results. But I couldn’t do that. Thanks for your help.
DanielJaramillo94
@DanielJaramillo94
For what is 'npm run build' usefull? How can I run the code that this command gives me?
Olivier Ballerini-Gendrin
@wBatdeveloppement4
@Vsnuv_twitter Your API should expose an explorer interface, you have no results when you type {"where": {"id": {"lte": 100}}, "skip": 10, "limit": 10}} against your car model?
sanketthecoder
@sanketthecoder
@wBatdeveloppement4 @Vsnuv_twitter A Quick question about implementing Microservices using loopback. As generally suggested the microservices should be loosely coupled. Then can anyone please explain how will the "relations" concept work in loopback keeping the above statement in mind. A)Should each microservice be built as a separate loopback application or
B)The models in a single loopback application should be considered as a microservice [But then would it hold the microservices properties? Individual Scaling etc]
Olivier Ballerini-Gendrin
@wBatdeveloppement4
@sanketthecoder I’m really not a specialist, but connectors can expose your microservice as a dataSource to consume by your models. I would say response A, but B can be a response either, depending on too many factors…
sanketthecoder
@sanketthecoder
@wBatdeveloppement4 Thanks a lot for your response. Can you suggest who would be the right person to address this question? I am really in a hurry to find out the answer or atleast some guide.