I understand that there is no built-in way in Sails.js/Waterline of populating deep nested associations yet, so I am trying to use bluebird promises to accomplish that but I'm running into a problem.  I'm successfully retrieving the user, and...
I'd like to add a default toDisplay function to all models which will use metadata, not unlike attribute/association definitions, to perform manipulations on the instance's attributes/associations making them suitable for display in the UI....
I have Video model:  module.exports = {    attributes: {     id: 'string',     tags: 'array'   }, }   I want to find all videos with tags for example "Hello" or "World". I could easy get all videos like: Video.find({ta...
I would like to know how to add "OR" condition in waterline query. Should look like:  User.find().where({      score: { '>': req.params.score},     status: 'user'     OR     status: 'admin'   }).exec(function(err, d...
I have set up a simple model with 2 instance methods. How can I call those methods in lifecycle callbacks?  module.exports = {    attributes: {      name: {       type: 'string',       required: true     }      // Instance methods     doSomet...
I'm running the beta version(v0.10.0-rc3) of Sails.js with the updated database adapter(for PostgreSQL) so that I have the functionality of associations via the Waterline ORM. I am trying to create a role-based user model for authorization depend...
I try to access to the findOne() through my Article model in my controller, without success.   I had this error     >  error: Sending 500 ("Server Error") response:  >      ReferenceError: Article is not defined >         at Object.m...
I'm trying to get a sails backend REST call that retrieves me items where either the "country" column or the "subCountry" column matches an array I have. I've tried:  {     skip: 0,     where: {         or: [             {coun...
I am writing a little REST API with nodejs, express and waterline. If I retrieve a record and return it with res.json(post); this contains data I don't want to display in the API (like IDs, associations, etc.).  Is there a way to tell waterline w...
I'm having MULTIPLE problems while using sails because I can't understand waterline promises and its logic.  I tried both built in bluebird promises and also even a async.waterfall implementation and couldn't succeed.  In a few words, I&#...

Tags

Recent Questions

Top Questions

Home Tags Terms of Service Privacy Policy DMCA Contact Us

©2020 All rights reserved.