waterline Questions

4

Is there a way to do select query and count_all query via single method? For pagination purposes we need to know total number of items so we can calculate and show number of pages.
Longoria asked 9/6, 2015 at 12:51

2

Solved

In sails.js 0.10 I'm trying to do the following // user.js module.exports = { attributes: { uuid: { type: 'string', primaryKey: true, required: true } , profile: { firstname: 'string', ...
Neckerchief asked 3/6, 2014 at 16:15

2

I have three models: user, noun, and usernoun (user_noun in PHP/Eloquent). There is a many to many relationship between user and noun. The "pivot" table has an extra attribute score. I can use this...
Scanlan asked 31/1, 2017 at 16:29

2

I need to add some additional data to result of find blueprint. I found this solution: module.exports = { find: function(req, res) { return sails.hooks.blueprints.middleware.find(req, res); } }...
Suppliant asked 13/9, 2016 at 10:40

4

Solved

Sails.js .10 rc8 I've completely run out of ideas for this I have a model called User and I want to associate it in a collection to other users like a friends list. Like a many-to-many associatio...
Toxophilite asked 7/10, 2014 at 3:20

1

I am using SailsJS on a project and I need to use native() for certain querys. The problem I have is that I can't find a proper way to instantiate a Waterline Model Object from the mongo collection...

4

I'm learning Node.js and Sails is my framework of choice. I want to use it in a project with MySql db and I think that Sequelize Orm is more complete. How can I use Sequelize Orm in Sails instead o...
Fadge asked 18/1, 2014 at 1:17

3

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 } // Ins...
Sunwise asked 17/10, 2013 at 8:3

1

Solved

I am working on an aggregate pipeline for MongoDB, and I am trying to retrieve items where the user is not equal to a variable. For some reason, I couldn't make it work. I tried to use $not, $ne a...
Rang asked 7/10, 2016 at 6:6

4

Solved

I'm having issues with Sails.JS 0.9.8. I would like to use promises with the Model.query() function (I use sails-mysql adapter). This code will work : User.findOne({ email: email }) .then(functi...
Obregon asked 19/2, 2014 at 16:35

1

var obsType = (from lk in db.LookUp join lt in db.LookUpType on lk.LookUpTypeId equals lt.LookupTypeId where (lt.FieldName == "OBSType") && !(db.OBSSetting.Select(k => k.OBST...
Punchinello asked 7/9, 2015 at 4:35

2

How can I select or update multiple records in oriento? Like in waterline we can offersModel.update({id:items_ids,status:INACTIVE},{status:ACTIVE}) But in waterline transaction is not available...
Shelve asked 4/4, 2015 at 12:37

2

I'm trying to push a local GIT repository to my Azure Website using .deployment & deploy.cmd. The problem is that when the script tries to install NPM packages it fails after about half is in...
Necessitate asked 6/10, 2014 at 13:25

2

It seems like Sailsjs/Waterline does not currently support a POINT type or geospatial indexing with JSON. Are there any ways to customize a schema for certain adapters to support geospatial datat...
Hrvatska asked 8/1, 2014 at 19:47

2

Solved

I am developing a sails.js app. In my previous sails app, I used MySQL with the default waterline ORM. I am planning to use Mongodb in my new app. I have come across limitations with waterline, one...
Bascule asked 17/6, 2015 at 7:16

1

Solved

I am working on a sails applications which contains multiple(>2) tables which I need to join with the help of populate method e.g. Category.js model attributes: { CategoryID:{ type:"integer", ...
Sonorant asked 13/1, 2016 at 15:16

1

Solved

I'm using SailsJs v0.11.3 and I want to use Promises to avoid using nested callback but I don't know how to return two objects from one stage (.then()) to another one. My code looks like this but ...
Undefined asked 6/1, 2016 at 20:18

2

Solved

In Sails.js, a lot of work is done for you by generating the models and controllers. The controllers allow for access to the data through API's. It allows for easy pagination by passing the start/s...
Fiorenza asked 30/12, 2013 at 15:56

1

Can I use pagination or limit + skip that has a return "total page" or "total count" in sails js?
Contrapuntist asked 5/10, 2015 at 7:37

1

Solved

It is properly working in my localhost. Issue only in another server. When I run this application from another server, getting a blank page like below, But api's are working properly. Landing p...
Cecelia asked 6/11, 2015 at 10:22

3

I cant seem to get the unique attribute to actually check/validate for unique values while using Mongo in SailsJS. I end up with identical usernames easily. Any thoughts? I checked the other post a...
Combust asked 19/8, 2014 at 11:30

2

how compare a datetime in sails.js Model? here it is what i did but without luck. var _date = moment().format('YYYY-MM-DDTHH:mm:ss.SSS') + 'Z'; Game.find({ where:{ active: true, start: { '>...
Malvasia asked 7/5, 2014 at 19:55

3

Solved

while the email validation rule fails on module of the sails.js, the server is crashing. Here the snippet of my module: // The user's email address email: { type: 'string', email: true, requir...
Aviation asked 16/4, 2015 at 13:8

1

Its really confusing to setup the best project structure for node.js I'm developing node.js application that works on Browser, Mobile and Desktop. This application has many modules like billing, su...
Goodlooking asked 2/5, 2015 at 7:59

1

By default, sails will populate all relationships within a model when it's corresponding API route is hit. Does anyone know if it's possible to toggle this functionality? If I'm working with a one-...
Marnamarne asked 14/5, 2014 at 0:43

© 2022 - 2024 — McMap. All rights reserved.