Hello friends I am writing the web service using sails js. I am fetching all posts and getting the following response :
[
{
id: "559458c51ccc9c716dabf666",
comments : [],
liked : {
data : [
{
id:…
I'm using sails.js and I can use API to modify data in mongodb, for example create new user, modify users etc. How to prohibit access to the API for non authorized users?
I'm using Waterline in my Sails.js app, with the sails-mongo adapter. I'm trying to get a record from my MongoDB searching by _id. This is what I've tried:
Case.findOne({id: args.itemId}).exec(function(err, retObj) {...}
Case.findOne({_id:…
I wrote an app using Sails.js with mongoDb(sails-mongo).
Firstly, I decided to write all to a single document...
And database slowed on 5GB of data..
"Slowed" means that basic find query executed in 30-50s..
Than I rewrite all in an multiple…
I'm new to NodeJs and SailsJs so be nice.
I've been using policies to complete a POST request which will eventually create a new model;
Policy to check that all request parameters are present, if any are missing then respond with 404 or similar…
I have a Sails.js app that needs to fetch from a Mongo database, then display that data in a graph. Alternately, it can take data from a JSON file located on the server.
I am struggling with that process immensely. What seems like it should be an…
I am trying to add attribute date in sails model sub document.But giving error.
{type:'array',model:'Recommendations'}
Recommendations.js
var Recommendations = {
attributes: {
role : {type:'string'},
user : {type:'string'},
userName :…
This is my code which is referred to sails documentation I want to upload an image for file controller action and get it upload and store it through user controller action upload and get. It is not working its show an
error: [object, Object].
file…
I'm trying to save an nested object inside a sails.js model.
This is how it looks like:
module.exports = {
schema: true,
attributes: {
label: {
type: 'string',
required: true,
},
consumption: [{
…
My models contain associations to other models which are obviously just stored with their ObjectId. What I want to know is if there is a way to pass in the option to expand either all associations or a particular set of associations.
So 'item model'…
from past two days i am facing this problem. whenever i restart my sails server session got expired and all users got logged out.
Is there any way to overcome from this ? I have gone through the sails doc but not successful to save the session in…
I'm using Sails v0.11.2 and MongoDB 3.2 on Mac OS X El Capitan and I'm trying to implement Many-To-Many association using Through option which isn't supported yet.
However, googling I found this Waterline Github Issue and elennaro, a github user,…
I've connected my SailsJs app to a Mongodb database. I'm working on an analytic application. These are the major models in my application:
User
Project
Report
Event
A user can have many projects, a project can have many reports and a report can…