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
10
votes
1 answer

Loopback testing with memory as datasource

I'm trying to use the memory-connector as a datasource when doing integration testing. But it seems to always connect to the mongodb-datasource. One major hack i have done is to change the datasource for each model to memory. But there must be a…
Are Almaas
  • 1,063
  • 12
  • 26
9
votes
3 answers

Can I use non-sequential id for loopback model?

Loopback uses sequential number for model ID. Can I use my own ID generator on server side? How do I go about doing that?
Sam
  • 1,288
  • 1
  • 13
  • 22
9
votes
1 answer

Override GET or any default method on strongloop

I need to override the GET on strongloop. So when I GET foo/ it returns something different as the default one. I tried using remoteMethod with http: {path: '/', verb: 'get'} without success. How can I override any default method on strongloop?
perseus
  • 1,322
  • 1
  • 16
  • 22
9
votes
1 answer

Loopback: Passing multiple object types in a remote method

I have an issue where when I pass two object types as a remote method argument, the first argument gets overwritten by the second argument. Below is code and results. How could I go about not having the second argument not overwrite the first…
emarel
  • 371
  • 7
  • 30
9
votes
1 answer

Diacritic Case-Insensitive search Loopback

Is there any way to query results on Loopback+MongoDB with Diacritic-Case-Insensitive options? For example, If I want to search for the query olimpic, and the database contains words like: Olímpic olimpic Olimpic Then, all of the above should be…
mhergon
  • 1,688
  • 1
  • 18
  • 39
9
votes
1 answer

LoopBack Storage Service, upload directly (without request object)

I want to upload a file to a storage container using the Loopback storage service. But the .upload() method expects a request object. But what if I want to upload an existing file that's not coming from a submitted form? Do I need to fake a POST…
Arne
  • 6,140
  • 2
  • 21
  • 20
9
votes
3 answers

Auto increment a property value in Strongloop loopback model

Is there a built-in way to auto increment a model's property value is Strongloop loopback ? This model has a property named orderNumber and I want it to start at 1 and increment by 1 every time a new model is created. This model is persisted to a…
Warren
  • 735
  • 7
  • 19
9
votes
1 answer

How to use TypeScript with Loopback

I'm using Loopback from Strongloop as a REST framework and ORM. I want to use TypeScript for my business logic. However, Loopback requires JavaScript with a specific shape to support their framework. For example: module.exports =…
A2MetalCore
  • 1,621
  • 4
  • 25
  • 49
9
votes
3 answers

loopbackjs: Attach a model to different datasources

I have defined several models that use a Datasource "db" (mysql) for my environment. Is there any way to have several datasources attached to those models, so I would be able to perform REST operations to different databases? i.e: GET…
Juanra
  • 8,532
  • 2
  • 15
  • 12
8
votes
2 answers

Top-level use of w, wtimeout, j, and fsync is deprecated. Use writeConcern instead

I am using mongodb with loopback and on successful connection I am getting below warning Top-level use of w, wtimeout, j, and fsync is deprecated. Use writeConcern instead. loopback version: 5.5.0 How to get rid of this? Kindly help
Profer
  • 553
  • 8
  • 40
  • 81
8
votes
1 answer

Is it recommended to publish source files for TypeScript node modules?

I noticed some TypeScript node modules (e.g loopback-next/packages) publish their source files with the node module. Is there a particular reason for this or is it just unnecessarily increasing the size of the module?
nflaig
  • 673
  • 1
  • 8
  • 15
8
votes
2 answers

Connections % of configured limit has gone above 80 from Mongo Atlas

Getting emails from Mongo Atlas that saying Connections % of configured limit has gone above 80. Using M0 Sandbox tier which has 100 max connections. Whether an upgrade to M2 tier (which has also 100 max connections) solve this?
Ashwanth Madhav
  • 1,084
  • 1
  • 9
  • 21
8
votes
1 answer

Loopback Email Connector not sending emails

I have a Loopback Application with a REST API. I want to make a REST API Enpoint /Email/sendEmail which sends an email. I did this tutorial: https://loopback.io/doc/en/lb3/Email-connector.html, but it's not working for me somehow. When I open…
BlockchainProgrammer
  • 1,999
  • 5
  • 20
  • 32
8
votes
4 answers

How do I return an error from a Controller in Loopback 4?

I have a controller method // ... inside a controller class @get('/error', {}) async error() { throw new Error("This is the error text"); } The response I'm getting from this error front-end is: { "error": { "statusCode": 500, …
Seph Reed
  • 8,797
  • 11
  • 60
  • 125
8
votes
1 answer

How to set a different Http Status in loopback 4

I can't find any ressources on how to change the success HTTP code using loopback 4. For example : 201 "created" on post method 204 "no content" on delete method I tried to specify this in the @api decorator but this change is not reflected in the…
Felix Movee
  • 326
  • 3
  • 11