Questions tagged [sails-mongo]

MongoDB adapter for Sails.js

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

400 questions
0
votes
1 answer

Chained insert into 2 tables in sails.js

For experts familiar with sails.js: I have a Customers Model and to keep it simple lets say /** * Customers.js */ module.exports = { attributes: { firstName: { type: 'string' }, lastName: { type: 'string' } …
0
votes
1 answer

SAILS JS 1.0 model callback lifecycle is not called

well, I'm trying to create a user with Sails 1.0.0-42, the problem is that the callback lifecycle of the user model is not called. I have tried in many ways and nothing is called. Thanks in advance. this is the code of Action2…
Leonardo Freitas
  • 101
  • 2
  • 11
0
votes
1 answer

Mongo find Document after Insert

i use sails js 0.12.14 with mongodb. if i try to get a document after insert the document the document is empty Products.create(product).exec(function(err, createdProduct) { Products.find({_id : createdProduct.id}).exec(function(err,…
0
votes
1 answer

NodeJS and Heroku: connect ECONNREFUSED 127.0.0.1:27017

I'm working with a nodejs over heroku using mLab with mongoDB and SailsJS I'm getting the same issue that are commented here: https://github.com/balderdashy/sails/issues/2480 (Error: connect ECONNREFUSED 127.0.0.1:27017) I'm already try all the…
Fernando Aureliano
  • 894
  • 12
  • 35
0
votes
1 answer

SaisJS - The condition in $match is not working

This is how my code looks like: User.native(function (err, collection) { if (err) throw err; collection.aggregate([ { $match: { id: req.params.id, createdAt: {">=":…
Sky
  • 7,343
  • 8
  • 31
  • 42
0
votes
1 answer

SailsJS - Error occurred connecting to multiple database: error: syntax error at or near "SELEC"

I have MongoDB used in my application, now I need to connect to Postgresql to get some other data. But after I add connection and model for Postgresql, there's an error occurred when I started the application with sails lift. Following are the whole…
Sky
  • 7,343
  • 8
  • 31
  • 42
0
votes
1 answer

Change more than one table via sails controller

I want my sails controller to perform these steps: -add word to Word table -take the created word's ID and add it alongside with lesson's ID to a different table module.exports = { add: function(req,res){ var eng=req.param('english'),…
K.W.
  • 59
  • 1
  • 10
0
votes
1 answer

SailsJS - Many to Many relationship

I've gone through the documentation a few times and am not certain on how to approach this inside Sails so looking for assistance. I have Programmer, Project, and Feedback. I want to link them so that Feedback can be submitted for a Programmer for a…
0
votes
3 answers

Database call in Sails.js beforeCreate() model hook causes validation error

I have a Sails.js model called "products" which is a MongoDB collection. In the model, I have a beforeCreate() hook that generates a unique productId like '170921-00001' in the format 'YYMMDD-count` where count is the record number created for the…
JackH
  • 4,613
  • 4
  • 36
  • 61
0
votes
1 answer

Cannot process POST request in Sails.js correctly

I'm trying to add comments functionality into my Sails.js blog application. However, I don't seem to write my controller action correctly. When I submit the comment form, the page starts to reload, but does not finish reloading. Here's my…
Denis Yakovenko
  • 3,241
  • 6
  • 48
  • 82
0
votes
3 answers

mongodb ObjectId find with sails, returns all the data

in my sails controller I have implement a function to find users. but when I try to search using ObjectId it returns all the data. I couldn't find any reason. but it works when I create a new separate field as "userID", and find using "userID". I…
0
votes
1 answer

SailsJS + Waterline + MongoDB - Should I stop using?

I am concerned that SailsJS + Waterline + MongoDB is not a winning combination anymore. Our application is using "Waterline Associations" more and more and I find its functionality is limiting my application. I want to find by association, which…
ChrisWorks
  • 207
  • 1
  • 4
  • 11
0
votes
2 answers

Sails.js, MongoDb: timeout when trying to connect; possible to use the connection pool?

Sails server: Windows 10 64-bit Sails.js 1.0.0-36 Node.js 6.10.2 MongoDB server: Centos 7 on Virtualbox, host networking only Mongodb 3.4.4, listening to all interfaces, no auth configured I can successfully lift Sails, connect the datastore,…
noderman
  • 1,934
  • 1
  • 20
  • 36
0
votes
0 answers

Ember Js and Sails js AND clause in controller

I'm working on a project with Ember.js and Sails.js now i'm having an issue in my controller, i want to run a computed query and use "AND" clause but i don't know how to do it, i tried to google it but had no luck here is my…
Abdul-Elah JS
  • 685
  • 1
  • 16
  • 36
0
votes
1 answer

emberjs using AND on querying from mongodb

I'm working on an Emberjs application and I've got quite far with it but i'm having an issue and I think that I've looked at every corner in the web without finding the solution Now my problem is that I have a dropdown that queries record on change…
Abdul-Elah JS
  • 685
  • 1
  • 16
  • 36