Questions tagged [loopback3]
14 questions
3
votes
1 answer
Loopback 3 updateAll filter is not working
I have the following model in Loopback 3:
{
"name": "rehearsalTest",
"base": "PersistedModel",
"idInjection": true,
"options": {
"validateUpsert": true
},
"properties": {
"creationDate": {
…

Leo Lozes
- 1,358
- 1
- 15
- 33
1
vote
0 answers
loopback3: associate users to different databases
I'm developing a project in loopback3 where I need to create accounts for multiple companies, where each compnay has its own database, I'm fully aware that the loopback3 docs has a section where they explain how to create datasources…

AIMEUR Amin
- 320
- 1
- 19
1
vote
1 answer
How to add NOLOCK for Auto generated SQL queries in Loopback 3
I'm using Loopback 3 and SQL. We've 20 million rows in SQL tables and when we query data using Loopback it's taking a lot of time and further observation we found queries are blocking in SQL. Noticed that the Loopback auto generated queries doesn't…

Prasad Kanaparthi
- 6,423
- 4
- 35
- 62
0
votes
1 answer
Loopback 3 updating model properties ensure old data is converted correctly without data loss
So I am using Loopback 3 atm, and I am currently updating the properties of my model. Problem is that the structure will be different as before as certain properties are now split into 2 separate properties, thus if I would place it online that data…

Billy Cottrell
- 443
- 5
- 20
0
votes
1 answer
How to find difference between dates in different documents using Loopback 3 remote method in MongoDB?
Suppose my 2 documents are like this in mongodb. How do I find date difference between the fields "eventCreatedAt".
I am using loopback 3 remote method implementation for this.
[
{
"eventType": "offer",
"currentPrice": 3,
"seller":…

Amaresh HM
- 51
- 7
0
votes
2 answers
flattening nested objects typescript
I am looking to flatten a nested object in my controller (new to Loopback and Typescript)
Here is my model :
export class SampleModel {
id: number;
code: number;
guide?: string;
gradeData?: string;
}
Here is an example object :
{
"id":…

Niv
- 271
- 1
- 7
- 16
0
votes
0 answers
Want to fetch data from roles, in which given accountId is present. (Javasscript, MongoDb)
Roles data model:-
Roles : {
id: string,
scopes: [
{
isOwnes: bool,
account: string(id),
privileges: array_of_string
}
]
}
In the below function I am storing all users, which is a lot of…

Parikshit Rathore
- 24
- 3
0
votes
1 answer
Function returns the object before, the findById() fill it with the required data
So, the problem is with the javascript basics I think.
'use strict';
module.exports = function accountWithSingleOrganisation(Account) {
Account.accountWithSingleOrganisation = function(accessToken, cb) {
accessToken.user(function(err, user)…

Parikshit Rathore
- 24
- 3
0
votes
1 answer
how to proxy to my domain with port from request urls that start with api?
I have a loopback 3 set up listening on the port 3000. And my front end app is built with Vue JS. ( I uploaded dist files to the server). Whenever I make an api call (https://example.com/api/xxx), I need to proxy to…

user3922691
- 37
- 4
0
votes
0 answers
Cannot read property 'connector' of null in Loopback 3
i have problems when i trying to run raw mongodb queries on Loopback 3, here is my code :
MyModel.getDataSource().connector.connect(function(err, db) {
var collection = db.collection('my_model');
collection.aggregate([
{$group : {…

azukhrufy
- 1
- 1
0
votes
1 answer
loopback4 application reads loopback3 models after migration
I migrated my loopback3 application to loopback4, as a last step of migration, I migrated loopback3 models, but when I change my model variables in loopback4, migrated application does not read that changes, It continues to read models from…

Alparslan Yılmaz
- 105
- 7
0
votes
1 answer
loopback tx.notifyObserversOf not a function error
In Loopback3, i am migrating from oracle to postgres and switched connectors and changed models just fine. Only error i have is this:
TypeError: tx.notifyObserversOf is not a function
at Timeout._onTimeout…

Nicos
- 303
- 2
- 19
0
votes
2 answers
How to pass winston logger object to Shared models in Loopback3
I'm using Loopback3 and trying to log message for shared model that are outside of project folder.
My project folder structure looks like below
myproj\server\logger.js // using winston logger here
myProj\common\models\ // I've couple of models…

Prasad Kanaparthi
- 6,423
- 4
- 35
- 62
-1
votes
1 answer
Howto create indexes using Loopback 3 and mongo
I have a model definition as such (snipped for sake of readability):
{
"name": "PlannerArchive",
"base": "PersistedModel",
"idInjection": true,
"options": {
"validateUpsert": true,
"strictObjectIDCoercion": true
},
"properties":…

batman567
- 826
- 2
- 12
- 23