Answers for "loopback 3 get all relations"

5

loopback 3 includes many

User.find({include: ['posts', 'orders']}, function() { /* ... */ });
Posted by: Guest on December-01-2020
1

loopback include multiple relations

Post.find({
  include: {
    relation: 'owner', // include the owner object
    scope: { // further filter the owner object
      fields: ['username', 'email'], // only show two fields
      include: { // include orders for the owner
        relation: 'orders', 
        scope: {
          where: {orderId: 5} // only select order with id 5
        }
      }
    }
  }
}, function() { /* ... */ });
Posted by: Guest on December-24-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language