LoopBack is an open source Node.js framework built on top of Express optimized for mobile, web, and other devices. Connect to multiple data sources, write business logic in Node.js, glue on top of your existing services and data, connect using JS, iOS & Android SDKs.
bajtos on add-node10
$unset
extended 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?
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"
}
},
{
"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
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
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.
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 :
Every clue is welcome.
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
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?