Questions tagged [sails-mongo]

MongoDB adapter for Sails.js

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

400 questions
1
vote
2 answers

sails -mongo : many to many relationship is not working in my app. followed the documentation still its giving empty array

I am using sails js with mongodb. here is my EventTags model: EventTags.js module.exports = { schema: true, attributes: { eventList: { collection: 'Events', via:'tagList' }, …
Anil Kumar
  • 187
  • 1
  • 9
1
vote
1 answer

What is the downside of using localDisk as storage means in Sails project

I am trying to decide what database to use in a Sails project. I started with localDisk and it works fine. I wonder why a database like Postgres or Mongo is needed. Could someone explain to me? Also since waterline abstracted the underlying…
windchime
  • 1,253
  • 16
  • 37
1
vote
1 answer

How to make a Sails model point to distinct databases on the go?

I'm creating a Sails application for which I got to do a panel administration for transactions to a model database. The point is, the backend architecture and data administration requires distinct databases for for same model in Sails application.…
diegoaguilar
  • 8,179
  • 14
  • 80
  • 129
1
vote
0 answers

process.nextTick() Error : Can't set header after they sent error in sails js

![enter image description here][1] I'm using sailsJs in my application. My server runs properly in my local, but server throws error "process.nextTick() Error : Can't set header after they sent". Local version is working fine, But server throws…
Aravinth
  • 397
  • 1
  • 4
  • 19
1
vote
0 answers

How to mark read messages?

I'm implementing a messaging app in SailsJS, but I need to mark an specific message when has been read. Right now users need to click on the conversation and browser will load the messages related. How Can I do that? This is my Conversation…
Allan Porras
  • 133
  • 1
  • 11
1
vote
1 answer

publishcreate, publishupdate does not work on associated collection in sailsjs

i'm totally new to sails association. i want to publish (publishCreate and publishUpdate) socket events in associated collection. i got one solution on Sails publish(Update) system does not propagate to associations my code is like…
Aravinth
  • 397
  • 1
  • 4
  • 19
1
vote
2 answers

How to properly debug the response lifecyle in Sails.js?

Using sails.js I got these controller methods which perform db requests and use promises. The problem is that they're working but when a request is performed a 504 is obtained at client side. I want to make sure my implementation is good and the 504…
diegoaguilar
  • 8,179
  • 14
  • 80
  • 129
1
vote
0 answers

Model with unique attribute is being created twice

I am using this passport-generate-auth module, and I am trying to get my grasp around understanding this whole thing. So, in my User model, I've got var User = { schema: true, attributes: { username: { type: 'string', …
Milkncookiez
  • 6,817
  • 10
  • 57
  • 96
1
vote
1 answer

Find in collection/object - SailsJS and Waterline ORM

I'm using SailsJS, so Waterline ORM and MongoDB. I'm saving multiple user IDs in an object within a collection called Labels (this is so that a label can belong to multiple users). I have a data structure in Mongo something like this: labels: { …
mcnamee
  • 508
  • 1
  • 5
  • 11
1
vote
1 answer

Sails 0.11 400 response when posting JSON array to blueprint route

I'm using Sails 0.11. Their docs say it is possible to post multiple objects to a blueprint route, just passing a JSON array. I'm trying to do this, but I'm getting 400 bad request as response. This is my case: I have a model called Prediction,…
Luis Crespo
  • 1,610
  • 1
  • 20
  • 33
1
vote
2 answers

Sails service returns MongoDb results when no Waterline associations exist but then fails when they DO exist

I'm building a sails.js api with MongoDb as my db. Those are my models (simplified just for the sake of this question): models/Passport.js simplified: identifier: { type: 'string' }, owner: { model: 'User', required: true …
SudoPlz
  • 20,996
  • 12
  • 82
  • 123
1
vote
0 answers

SailsJS Many to Many - Some objects in a controller

I post here , because I recently start a development project with sails and MongoDB 3.0.2. I am a beginner with this framework and his ORM (aka waterline). In my project I've two classes : listeners and titles, and I need to do this relations : N…
outstore
  • 175
  • 2
  • 13
1
vote
1 answer

Unreachable MongoDB after few minutes running Sails.js App on my server

I want to create an API service for a project. I'm creating this service with Sails.js. I pushed this Sails app on my dedicated server running with pm2. My problem is that each 2 minutes I can't access to the data of my MongoDB database, running on…
I'm_ADR
  • 1,017
  • 8
  • 15
1
vote
1 answer

Where to put custom advanced queries in a sailsjs mongodb stack

I want to proceed with more advanced queries in a sailsjs and mongodb stack where sailsjs is setup to serve as an api with data against a front end client. I've been able to fetch data with some basic queries but now looking into on how to proceed…
Dilemmat_Dag
  • 383
  • 1
  • 4
  • 14
1
vote
0 answers

sails won't populate user (undefined)

I try to associate a chat message with an user. But the populate function gives me an user undefined //message.js module.exports = { attributes: { user:{ model: 'User' }, message:{ type:'string', required:true …
klanm
  • 3,168
  • 3
  • 19
  • 22