Questions tagged [sails-mongo]

MongoDB adapter for Sails.js

Sails-mongo allows connecting to from using the ORM api.

400 questions
1
vote
0 answers

sails-mongo does not throw errors when mongodb gets down

I am using sails-mongo with Sails v0.12.13 and realize that if mongodb stops, when I do some request to the controller (using curl) the request get stucked for a while and then returns no error in the application logs. I just get the message on the…
manasouza
  • 1,189
  • 1
  • 14
  • 26
1
vote
2 answers

Not able to integrate Keycloak with Sails. Able to integrate Keycloak with Express

Keycloak is an open-source authentication and identity management solution written in Java. It provides a nodejs adapter using which I am able to successfully integrate with express. Here is the routes file which works: 'use…
1
vote
1 answer

SailsJS Perform sorting on populate data

Here is my current event model: module.exports = { attributes: { name: { type: 'string', required: true, unique: true }, client: { model: 'client', required:…
Panic
  • 113
  • 5
1
vote
1 answer

Sails creating data into many to many relationship

I currently have two collections, which are Schools and Contacts. The Schools collection has already been populated with thousand of data while Contacts is a new collection which is still empty. Now there's a schema change for both of them. Here's…
Dicky Bullin
  • 259
  • 1
  • 2
  • 10
1
vote
2 answers

Using different mongo database than admin in sails

I'm struggling to connect with sails to a mongodb database that uses a database for authentication named "dbadmin". Where I am DBA decided to have all users centralized in a users database. I can connect to this "dbadmin" database but then sails…
guillem
  • 2,768
  • 2
  • 30
  • 44
1
vote
2 answers

sails lowers without process.exit - feature or mistake?

My sails.js app is running under PM2, and I'd like PM2 to be able to restart the app, which it does in the case of a crash. The thing is, when sails fails to load a hook, for instance, if a DB is not available at startup, then the graceful…
dandanknight
  • 659
  • 5
  • 21
1
vote
1 answer

Store array of ObjectId's in sailsjs using waterline ORM

I'm trying to store array of Object Id's of another model. Sub Service skills: { collection: 'subservice', via: 'contractors' }, Contractor Model contractors : { collection: 'contractor', via: 'skills' …
Talib Allauddin
  • 123
  • 3
  • 16
1
vote
1 answer

Waterline: query array using AND for elements

I have a model with { title: 'title', tags: ['foo', 'bar'] }. How would I query all documents containing tags foo AND bar at same time without going native? I tried ContentEntry.find({tags: ['bar', 'foo'] }) but this returns documents having…
scorpp
  • 635
  • 10
  • 16
1
vote
2 answers

How to use multiple database connection with one model dynamically in sailsjs?

I am beginner in sailsjs, i have multiple databases but table structure is same. So i would like to use single model and controller for all these databases. I know we can set connection attribute in model like this module.exports = { …
Jackson Harry
  • 308
  • 1
  • 2
  • 15
1
vote
1 answer

How to restrict http request type in sails.js?

In sailsjs blueprint api,By default, action route responds to all four types of requests - GET, POST, PUT, DELETE. I would like to deny only certain types of request to a route, while allowing the others to go through. For example, I may wish to…
Gautam Bhalla
  • 1,170
  • 2
  • 10
  • 16
1
vote
1 answer

cant use .native function in sails mongo

I've been working around some ways to use .native() to do a simple aggregation function in sails with mongo. Already following the steps to install dependencies. (http://sailsjs.org/documentation/reference/waterline-orm/models/native) But still it…
1
vote
1 answer

Connect Mongodb to Sails JS

ive read various tutorials and instructions how to connect sails to js. Every tutorial is telling me to do this. I am new to mongodb btw. I followed the instructions install sails-mongo (npm install) Edit the config/connection mongo: { adapter:…
Lemon
  • 199
  • 1
  • 2
  • 12
1
vote
1 answer

Using legacy mysql database with new sails application

When setting up sails models to use an existing MySql database with string primary keys (PK), the PK is no longer generated automatically. Am I missing something or do I have to implement the PK generation in beforeCreate? If I were to implement the…
danba
  • 842
  • 11
  • 32
1
vote
1 answer

Waterline: Sum/Avg/Mix/Max of populated values in waterline

Please see the example: User Object: { name: 'Mike', age: 16, createdAt: Wed Feb 12 2014 18:06:50 GMT-0600 (CST), updatedAt: Wed Feb 12 2014 19:30:54 GMT-0600 (CST), id: 7 } Pet Objects associated with the user Mike { …
swapnilagarwal
  • 1,126
  • 8
  • 16
1
vote
1 answer

Node.js Getting Error when saving session in database, Sails.js using sails-mongo module?

i have gone through the sails doc http://sailsjs.org/documentation/reference/configuration/sails-config-session db configuration is adapter: 'sails-mongo', host: 'localhost', port: 27017, db: 'sails', collection: 'sessions', Getting…
Ankur
  • 51
  • 4