waterline Questions

2

Solved

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 proble...
Rubrician asked 23/10, 2014 at 19:19

1

Solved

Looking to query against the date only anyone encountered this? Sample code: ////MODEL module.exports = { attributes: { date: { type: 'date', required: true } } }; ////CONTROLLER var...
Hudibrastic asked 18/8, 2015 at 17:7

2

Solved

I'm working with sails.js waterline orm. Now this is not particularly a sails question, but i have to place some context, so when you create a record you get back an object with the data created. I...
Statocyst asked 15/8, 2015 at 22:8

1

This might be a very simple question but I don't find anything about it in the Waterline docs. How is it possible to get an instance of a Waterline model without immediately saving it. Model.crea...
Nephrolith asked 18/6, 2015 at 21:11

2

I tested the following Employee.js model in Sails.js and I found something that seems hard for me to understand. When the form for creating a new Employee is posted, I got the following errors wi...
Airedale asked 17/11, 2014 at 1:44

1

Waterline is an excellent ORM but I noticed that there are many features that are not present yet on waterline but Sequelize already have. So I have decided to switch to sequelize but still using S...
Marishamariska asked 11/6, 2015 at 23:5

1

As shown in that stackoverflow answer, having no support for cascading (cascading deletes in particular) in Waterline there is a workaround for one-to-many associations by using the afterDestroy (o...
Salsala asked 23/12, 2014 at 16:25

3

Solved

I want to make a request like: User.find().exec(function(){}); I know I can use toJSON in the model however I don't like this approach since sometimes I need different parameters. For instance i...
Epistasis asked 5/6, 2014 at 19:1

1

Solved

I want to create a not persisted new instance from a model, populate some attributes and send it back as a JSON response from a controller action. In rails it's pretty simple to get a new instance ...
Impropriety asked 9/5, 2014 at 7:44

1

Solved

I'm trying to implement Passport strategies into a sails hook, like this I can share on multiple project. When I try to log I have this error : Error: passport.initialize() middleware not in use...
Watchword asked 12/5, 2015 at 19:56

1

Solved

I'm pretty new on Nodejs and sails. I'm implementing a server which is similiar to Twitter. In user model, there should be 2 fields: follower and following, and the 2 fields are association of the ...
Bowl asked 2/5, 2015 at 3:5

1

I very new to production sailsjs environment, I need a way to add table changes which I make in my sailsjs Models in Dev to be applied to Sailsjs Production Models. Does anyone dealt with this bef...
Greenway asked 2/5, 2015 at 21:8

3

So I have been playing with NodeJS/Express for a little with now and I would really like to try to rewrite a relatively large side project using a full JavaScript stack just to see how it will work...
Doloresdolorimetry asked 22/7, 2013 at 18:29

1

Solved

I just lost 11,000 records from my database just running the command for sailsjs without the --prod part in it, So I thought I should ask whats the best way to change the tables on production serve...
Propylene asked 2/5, 2015 at 3:13

1

Solved

This is my College model module.exports = { attributes: { name:{ type:'string', required:true }, location:{ type:'string', required:true }, faculties:{ collection:'faculty', via:'coll...
Rhiana asked 29/4, 2015 at 10:5

1

I'm doing my own custom validations on certain fields, so that only certain values are accepted (depending on the field) and the rest rejected. I would like to write a "filter" function that checks...
Trinity asked 27/3, 2015 at 22:24

1

I am using waterline ORM in sails.js. I have a user model and another coins model which associates to the user model. //coins.js attributes: { name: 'string', // Associations userId: { model:...
Indubitable asked 23/4, 2015 at 12:28

0

I have a find query that returns multiple results of an object, this object contains a model that contains another model, the thing is that waterline doesn't support nested populates, so it populat...
Impending asked 12/4, 2015 at 10:49

1

Using Waterline ORM from SailsJS, my defaults for autoCreatedAt and autoUpdatedAt are set to false, but I still need to implement to the functionality just using different field names (DBA request)...
Gap asked 28/7, 2014 at 2:0

1

I have these models: // Material.js module.exports = { attributes: { name: { type: 'string', required: true }, source_info: { type: 'string', required: true }, category: { model: 'categ...
Butternut asked 13/8, 2014 at 3:26

2

Solved

I'm using sails 0.9.16 with Postgres and my question is: what is the best way to execute transaction using current API with promises? May be there is something better than: Model.query('BEGIN TRA...
Pulverable asked 11/7, 2014 at 6:29

2

Solved

A very simple question but I am unable to find the answer to it. So in my Sails app I have a User model and I am trying to make a boolean field with a default value to be False. Is there a way to ...
Superlative asked 3/5, 2014 at 11:29

2

Solved

I have created a web app with node.js, express, and angular.js in the past. I am starting a new project and I want to also use MongoDB. That would be the MEAN stack. Using just MEAN, I could start ...
Highcolored asked 31/1, 2014 at 16:40

2

I'm using 'sails-memory' as the database for my Sails unit tests and ideally would like to clear the entire database after individual tests. Is there a way I can drop the entire database?
Venetis asked 26/9, 2014 at 16:8

2

Solved

Suppose I have this model: module.exports = { attributes: { title: { type: 'string', required: true }, content: { type: 'string', required: true }, createdBy: { type: 'string', req...
Morita asked 6/2, 2015 at 16:36

© 2022 - 2024 — McMap. All rights reserved.