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

Setting password field to 'required' in Sails Mongo blocks beforeCreate

My API uses SailsJs and MongoDb. For user creation, I am using the beforeCreate lifecycle callback to run bcrypt to hash my password field. I encounter this wierd error, wherein if I set my encrPassword field to {required : true} my code stops…
Paulo
  • 325
  • 3
  • 16
0
votes
1 answer

how to model subdocument (MONGODB) in sails.js

Hello any of you know how to model this document from MONGODB in sails.js? this is a example, of the document on mongodb { "Iden_Codigo" : "13444", "Iden_Aseguradora" : NumberLong(25), "AdaptacionCanguro" : { "AC_LugarAC" :…
0
votes
1 answer

Find all where parameter is within an array - Waterline

In pseudo code, it'd be as so Find all businesses where the outcodes array contains NG1 I'm having a hard time finding something that works, and waterline throws it's Invalid usage at everything I try. Business.find({ or:{outcodes:…
K20GH
  • 6,032
  • 20
  • 78
  • 118
0
votes
0 answers

Sails v1 Blueprints API query error on one-to-one attribute when there's no value

After I upgrade to Sails v1, all the blueprint APIs that have the one-to-one relationship do not work when the FKs do not exist in the record. I am getting the following error message in the query response. { "name": "AdapterError", …
SzeLee Lai
  • 25
  • 1
  • 7
0
votes
0 answers

how can I send user's information to user account view in the sails.js

I disable blueprints rooting ( actions: false, rest: false, shortcuts: false ) and i want when a user login i can capte user's information in the "account" view, i use mongodb database and sails-mongo as adapter UserController.js account :…
0
votes
0 answers

Schedule jobs at midnight w.r.t time zones

I have created a web application in which I'm using sails.js framework and mongodb for back-end purpose. I want to implement a cron job running at midnight of each day so that I can calculate previous day's power consumption of a property. This data…
Chetanraj
  • 19
  • 3
0
votes
1 answer

[SailsJS / sails-mongo]SNI name

I'm trying to configure a MongoDB connection in SailsJS through sails-mongo, but no matter how I configure it, I'm getting this error. MongoError: no SNI name sent, make sure using a MongoDB 3.4+ driver/shell. Could you assist me please?
EzeTeja
  • 1,125
  • 1
  • 13
  • 21
0
votes
1 answer

azure sails the hook 'orm' is taking too long

I am following this guide: https://learn.microsoft.com/en-us/azure/app-service-web/app-service-web-nodejs-sails-cli-nodejs In section "Connect to a database in Azure" step 10, I am getting the error: Error: The hook 'orm' is taking too long to load.…
Logan_B
  • 527
  • 1
  • 7
  • 22
0
votes
1 answer

Azure Appsetting dbuser not working

I am following this guide: https://learn.microsoft.com/en-us/azure/app-service-web/app-service-web-nodejs-sails-cli-nodejs I am at step 6 of "Connect to a database in Azure" section azure site appsetting add dbuser="" I type in my…
Logan_B
  • 527
  • 1
  • 7
  • 22
0
votes
1 answer

which method to override this path /user/4/station in controller with sails js API

Just want to know which method i need to override to access to this route: /user/4/station I override this method User.findOneByStation generated by sails, but still return the ressource, i need to make computation on this ressource before return…
Arthur
  • 27
  • 7
0
votes
1 answer

How To Populate some filed(column) from table in sails + mongo

In Sails I don't need UpdatedAt And createdAt column every time in find, update or in populate method. In mongoose we can do in This way: db.collection.find({}, { UpdatedAt:0, createdAt:0 }) But in sails, I don't know how to do that. Is…
Nitesh singh
  • 915
  • 11
  • 21
0
votes
1 answer

exam app model structure for sailsjs API

I am building a mobile app for exam practice. I need an API endpoint for the exam details and questions. I need help with structuring my data in sails.js. I have this JSON structure from firebase in mind. The endpoint GET operation should return…
0
votes
2 answers

Error: The hook `orm` is taking too long to load

whenever trying to lifting sails it gives me the hookTimeout error every time. While for the same configuration settings it's perfectly running on other systems. using Ubuntu 16.0.4 and Manjaro nodejs version 7.4.0 sails version 0.12.11 Mongodb…
NavlK
  • 1
  • 1
0
votes
1 answer

Model Update fails with no error

I'm just trying to generate a user during the bootstrap process. I hit his update statement and the process stops, then times out after 10 seconds with "Bootstrap is taking unusually long to execute its callback (10000 milliseconds)." Update error…
mryarbles
  • 378
  • 2
  • 8
0
votes
1 answer

Sails update query, output should have selected colums

I am using sails-waterline ORM for my application. I know how to get the selected columns in find query using 'select', but is it possible to get the same with the update query? If yes, let me know, how can i achieve this.
Foramkumar Parekh
  • 421
  • 1
  • 6
  • 26