I'm using SailsJS / Waterline ORM with a Mongo DB. It's a realtime application so the sails sockets.io pub/sub is used heavily.
I have a few instances in my application which require many-to-many and many-to-one associations.
I'm fairly sure I can…
Waterline populate gives me an empty collection when I try to populate a junction table (model) with another junction table (model). I'm using many-to-many through relationship as given…
I'm using Sails built in models and it's ORM to perform MongoDB queries and operations. The problem I got is that, for some query methods,it's callback is never being called. The DB operation gets done, but callback won't come up. Following code…
In mysql, I can retrieve specified columns by using:
User.find({select:['email']}).....
Now I am moving to mongodb, I tried:
User.find({select:['email']}).....
User.find({},{email:1}).....
User.find({},{fields: {email:1}})....
But none of them…
in my production environment that uses MongoDB, whenever a model validation fails it shows nothing, while on my development environment with no database it shows something like this:
{
"error": "E_VALIDATION",
"status": 400,
"summary": "10…
I'm using sails 0.11 and sails-mongo 0.11.2 adapter.
I have a user model with a nickname, and I want the nickname to be unique among every user. I specify the attribute as unique like this:
nickname: {
type: 'string',
unique: true
}
It is not…
I'm using sails with mongo db over waterline.
Lets say that I declare 2 models in my sails project like so :
A user model @ models/User.js simplified:
username: {
type: 'string',
unique: true
},
passports: {
collection:…
I've created a sails.js application.
I'm trying to get full related model Creator in view but I get only id...
How can I do this?
I'm doing this:
Model Author.js
module.exports = {
attributes: {
name: {
type:…
I use sails.js with MongoDB as primary place for my models. I've just completed data migration from production DB, and now there are several hundred thousands documents in some collections.
But there is a problem. When I try to sails lift i'm…
I am new to sailsjs and currently working on project that uses sailsjs. I want to change the default database to mongodb. I did it in config/local.js like following
connections: {
'defaults': 'mongo',
mongo: {
module: 'sails-mongo',
…
I am trying to write a sails waterline query with two 'or' clauses where both have to be true, but it seems to not work. This is the query that I have tried but it pulls only when one of the 'or' clauses meets its criteria, which I am trying to…
I'm building a very simple API with sails which handles participants and teams . Teams might have several participants, so the API should accept multiple participants IDs to create the relationships when creating a new team.
Participant…
I have an application that I am considering porting to Sails.JS.
One of the big issues I am having is supporting the per-request database selection that we have right now.
Our app creates/uses a different database for each customer that we have and…
I am newbie to sails and node.js. I am creating a Forum and want to add search function in order to search threads that match with User Search input. My search function need to character wise match the user entered characters with database thread's…
I have a User controller that has a create method that checks the database for email and username uniqueness before creating the user (this is to work-around a bug in the mongodb adpater for SailsJS that doesn't honour the unique attribute flag -…