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...
Continuation of this bug :  API Versioning in SailsJS  Sails Permissions AuditPolicy is not working properly. can any one guide me to do.  O/P:     error: Sending 500 ("Server Error") response:    Error: Invalid route option, "model"....
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 struggling with where to put my business logic in my SailsJS project.  My data model is as follows:  Portfolio (hasMany) -> Positions (hasOne) -> Asset-> (hasMany) Ticks    I'm looking to aggregate data of the children using comp...
I have a single-page application that is feeding on an API I wrote in JavasScript running on Node.js and using MongoDB for data storage. The API exposes several different content types, each of which is stored in a separate collection in my MongoDB d...
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...
TestController.js:  module.exports = {     test: function(req, res) {     User.findOne({}, function(err, found) {       console.log(found);       return res.send(found);     })   } };   The User model contains one single entry. When this controller r...

Tags

Recent Questions

Top Questions

Home Tags Terms of Service Privacy Policy DMCA Contact Us

©2020 All rights reserved.