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…
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…
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…
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…
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…
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'
…
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…
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 = {
…
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…
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…
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:…
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…
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
{
…
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…