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

How do I access a query string parameter in loopback model?

My api endpoint is like as follows for a model definition product.js api/products/9720?id_shop=1&id_lang=1 I need to access the id_shop in product.js to apply a where clause before it fetches the records from products…
ralixyle
  • 754
  • 1
  • 7
  • 18
5
votes
1 answer

How to store Oauth response in postgresql?

I am using loopback framework(Node.js) with angular js(front end) and postgresql (DB)for my application,In my application i used third party login "passport-google-oauth". After the google auth, call back url return the response as below mentioned…
siva
  • 593
  • 3
  • 8
  • 19
5
votes
2 answers

Strongloop error: Cannot find module 'options'

I wanted to deploy my app on remote Linux server. I am using loopback and I wanted to follow instruncions in docs. Ive build an app using arc, started proces manager on remote host and deployed it using slc deploy http://my.host. Deploy was…
Arth
  • 545
  • 1
  • 6
  • 11
5
votes
1 answer

Validate uniqueness of combination of multiple fields of a model in loopback

How to ensure uniqueness of a combination of multiple fields in loopback model. Like below is the model Organisation, I have two field name and contact in it, I want the combination of these two fields to be unique in the database. For example :-…
navi
  • 78
  • 4
5
votes
0 answers

Dynamically changing the datasource of model in strongloop

I have created a mixin in which I am trying to override the getDataSource method of all the models like: Model.getDataSource = function() { console.log('Overriding the getDataSource for model ' + Model.modelName); // Code to attach the new…
Satyendra
  • 51
  • 4
5
votes
5 answers

Loopback beforeRemote for PUT requests

Using Loopback framework, I want to perform some operations before the Item is edited hence I am trying this but unable to bind this to the update hook. Item.beforeRemote("update", function(ctx,myitem,next) { console.log("inside update"); …
Swapnil Gondkar
  • 345
  • 1
  • 4
  • 12
5
votes
3 answers

Add nested remote method with loopbackjs

I'm using strongloop's loopbackjs at work to implement an API. For a model Cat I have defined a remote method, lets call it meow. So i can do: GET /cats/{:id}/meow The Cat model belongsTo the User model. Now I would like to be able to do something…
user5655560
5
votes
1 answer

loopback-storage-component how to display picture - file

I am using loopback-component-storage for uploading images to server. https://docs.strongloop.com/display/public/LB/Storage+component I have also AngularJS JavaScript SDK so my lb-services.js is dynamically…
Alan
  • 108
  • 7
5
votes
1 answer

Strongloop-Loopback query string parameters

I'm working on a REST api, and thinking about cutting down on development time by using the Loopback framework. I like a lot of things about the framework (and it seems to fit my needs), but I completely dislike…
Ana F
  • 641
  • 4
  • 13
5
votes
1 answer

loopback.io: Not In query

I'm trying to do a not in query in loopback.io. But couldn't find any feature related to that. Here is what I have tried: Product.find({ where: { name: { like: '%' + searchTerm + '%' }, id:…
droidbot
  • 937
  • 1
  • 10
  • 26
5
votes
4 answers

loopback: distinct query

I am using Loopback to create Rest API. Need to fetch distinct data based on a particular column from a collection. I tried below, but it's not working, instead the below snippet is fetching duplicate data also: this.app.models.location.find( …
Heena Ghai
  • 63
  • 1
  • 3
5
votes
1 answer

loopback automigrate vs autoupdate

When we have model and we want to migrate it to database, we simply create script in server/boot with: server.dataSource['myDbSource'].automigrate('MyMode', function(err){...}) or server.dataSource['myDbSource'].autoupdate('MyMode',…
Krzysztof Sztompka
  • 7,066
  • 4
  • 33
  • 48
5
votes
2 answers

Can I define a custom validation with options for Loopback?

Is there a prescribed way to create a custom validator in loopback? As an example, assume that I want to create something like: Validatable.validatesRange('aProperty', {min: 0, max: 1000}) Please note that I am aware…
Cliff Chaney
  • 414
  • 5
  • 13
5
votes
2 answers

How can I override builtin login method in Loopback?

I've created a new User model, based on builtin one. I'm trying this: module.exports = function(TiUser) { TiUser.on('dataSourceAttached', function(obj) { var login = TiUser.login; TiUser.login = function(credentials, include, cb) { …
F3RD3F
  • 2,309
  • 3
  • 22
  • 26
5
votes
3 answers

How can I replace the default favicon in an slc loopback generated webapp?

I have generated an app using slc loopback command. So the generated express webapp has its strongloop favicon. How can I change the favicon? I am using this in server.js app.use(loopback.favicon(path.resolve(__dirname,…
Arth
  • 545
  • 1
  • 6
  • 11