Questions tagged [loopbackjs]

LoopBack is an open source Node.js framework built on top of Express.js 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, build REST APIs and connect using JavaScript, iOS, and Android SDKs.

The LoopBack framework is a set of Node.js modules that you can use independently or together. An application interacts with data sources through the LoopBack model API, available locally within Node.js, remotely over REST, and via native client APIs for iOS, Android, and HTML5.

Using these APIs, apps can query databases, store data, upload files, send emails, create push notifications, register users, and perform other actions provided by data sources and services. Clients can call LoopBack APIs directly using Strong Remoting, a pluggable transport layer that enables you to provide backend APIs over REST, WebSockets, and other transports.

See also

2853 questions
8
votes
2 answers

Loopback postgresql relation "public.acl"

I am new to loopback and i am just started to implement the tutorial https://docs.strongloop.com/display/public/LB/Connect+your+API+to+a+data+source But i am receiving the error: [error: relation "public.acl" does not exist]. I searched a lot for…
Subburaj
  • 5,114
  • 10
  • 44
  • 87
8
votes
1 answer

What's the difference between hasMany and referencesMany in Strongloop loopback

I read that embedsMany (in case of non relational db) puts the embedded models in the parent model document. While hasMany creates a new collection of child model and a relation is created between parent collection and child collection. What about…
Sanandrea
  • 2,112
  • 1
  • 27
  • 45
8
votes
1 answer

Loopback + connect multiple database

I am using loopback framework with nodejs. Is it possible to connect multiple database at a time. For example I have two different database. 1. Mysql Database - A 2. Postgresql - B Some pages get data from A database and some pages need get data…
RSKMR
  • 1,812
  • 5
  • 32
  • 73
8
votes
1 answer

Server-side React: Babel doesn't transform JSX on the server neither on the fly not manually. Why?

I use LoopbackJS framework for Node.js (the same as Express because it is based on Express). And I cannot set React server side rendering. I followed this article, and answers here on Stackoverflow, and other articles, doesn't work. Babel docs are…
Green
  • 28,742
  • 61
  • 158
  • 247
8
votes
1 answer

Migrating built-in models to Databases

How to move built-in models like User, Roles, User-Role-Mapping etc... to the database we've created instead of the default datasource:db? The built-in models are not listing in Arc. I've tried creating a new model which inherits these base model.…
Anoop Thiruonam
  • 2,567
  • 2
  • 28
  • 48
8
votes
5 answers

Dynamic Properties or Aggregate Functions in Loopback Models

How would I go about using aggregate functions in Loopback models? If I have a model backed by a mysql database, could I have Model1 with a hasMany relation to Model2 (with a given numeric property), and have a property in Model1 that grabs the SUM…
jcq
  • 277
  • 1
  • 4
  • 10
7
votes
0 answers

Loopback4 connect to Elasticsearch

How to connect loopback4 server app with Elasticsearch DB. I have tried with below reference links. but they have not explained for loopback4. And have did same implementation using below references but not able creating mapping properly to fetch…
indrasena
  • 101
  • 1
  • 7
7
votes
2 answers

Loopback 4: Upload multipart/form-data via POST method

I'm working in Loopback 4 and getting stuck in creating a POST method so that client can call this method and upload a multipart/form-data. I read some…
7
votes
1 answer

How to Use Decimal128 in Loopback Via REST Api

I would like to utilise the MongoDB Decimal128 Data type in loopback. Note: I don't want to use the Number type. My model: { "name": "Mongoproduct", "options": { "validateUpsert": true, "strictObjectIDCoercion": true, "relations":…
Martin Thompson
  • 3,415
  • 10
  • 38
  • 62
7
votes
4 answers

Loopback search on all fields

I am using loopback as a backend now I wish to be able to search across all fields in the table For instance, take the following table fields: id, name, title, created, updated Now say I want to search across the table using the following string…
Marc Rasmussen
  • 19,771
  • 79
  • 203
  • 364
7
votes
3 answers

Loopback support for async/await

I'm using loopback 3 to build a REST service, and I want to use the async/await instead of having to use the callbacks. So instead of doing that: MyModel.myFunction = (callback) => { MyModel.find({where: {id: 2}}, (e, data) => { if (e) return…
khernik
  • 2,059
  • 2
  • 26
  • 51
7
votes
0 answers

Loopback Model - add a count field for a hasMany relation Model

Is there a way to count the number of instance of a related model, without using an include on the filter? I already found loopback-counts-mixin, but I am hoping that there is a native way of doing it.
Mark Ryan Orosa
  • 847
  • 1
  • 6
  • 21
7
votes
2 answers

Loopback Find then update attribute or delete by id

Been trying to find samples usage for some of the static methods for a persistedModel in Loopback. https://apidocs.strongloop.com/loopback/#persistedmodel-prototype-updateattribute it just says: persistedModel.updateAttributes(data, callback) But…
Mark Ryan Orosa
  • 847
  • 1
  • 6
  • 21
7
votes
2 answers

Remote method with get parameters in url using loopback

i'm trying to add a get remote method to my api using loopback 2.0 in order to achieve the same method structure as the default ones, such as : /myObject/{id} The way I've tried is : MyObject.remoteMethod( 'remotemethod', { http: { …
Devz
  • 563
  • 7
  • 23
7
votes
2 answers

Why is this nested relation in LoopBack returning duplicate results?

When I query to include a nested model – e.g. GET /api/Widgets/1?filter={include: {"foos": "bars"}} – I get duplicate foos in my results. I thought this was due to a LEFT JOIN or something like that, as I'm using MySQL, but when I run LoopBack in…
Charlie Schliesser
  • 7,851
  • 4
  • 46
  • 76