i want to fetch category and inventories of same category,
i can fetch inventory and its category by using populate.. but i want revers of it.. but i dont know how.. i use populate function but it is not working
Inventory Model
"use…
I am to a fair degree familiar with Sails and Waterline.
Situation:
We have a Model Playlist with a many-to-many association to the Model Song on sails-mongo.
When we query for all playlists, we do not want to sideload all associated songs, we just…
I'm using sails 0.11.2. With the latest sails-mongo adapter.
I have a very large database (gigabytes of data) of mainly timestamp and values. And i make queries on it using the blueprint api.
If I query using…
I am working in SailsJS and I am attempting to build a REST API back-end for my mobile app that allows for a Newsfeed path so that if I query JSON on the front-end I can get it all from www.website.com/user/id/Newsfeed. Where the Controller gets…
I'm trying to use the destroy method with a lower than in the request, and I can't make it to work.
Although, the find method returns some content with the exact same parameters.
Cars.find({userId: params.userId, accessDate: { '<=': new Date() }},…
I recently started working with Sails and mongo.
I use Sails blueprints to generate part of my api.
The problem is, that the request body I send is being saved to the mongo collection, regardless of the fields defined in the model.
So for example,…
I had assumed that the Sails model schema: true config option worked in two directions; i.e. that it 1. would strip out extra fields not defined in the attributes hash before writing to the database, and 2. strip out any extra fields in the database…
I am looking for a way to perform MongoDB's upsert operation in waterline. One way is to use the native method.
Model.native(function (err, Collection){
Collection.update({"key": "val"}, {"$set": {"x": "val"}}, {"upsert": true}, function (err,…
I am newbie in sailsjs and try to learn by following the tutorial, I a getting 500 internal error while inserting post.
Here is my all files:
//DashboardController.js
newpost: function(req, res){
var params = req.params.all();
var…
SailsJS with MongoDB adapter not working as expected. I have following relations defined:
Post.js:
module.exports = {
connection: 'mongodb',
attributes: {
title: 'string',
categories: {
collection: 'postCategory',
via:…
I am using sails js with mongodb.I need to implement push notification for android and ios. how can i implement it. I searched lot of things in internet regarding push notifications in sails js but i didn't find any useful resources for…
I have a question. I think i am doing something wrong.
I have two models:
tutorType and Student.
Here is my Student
module.exports = {
attributes: {
tutor1Name:'string',
tutor1Type: {
model: 'tutorType'
},
contact: {
…
I am right now attempting my first Heroku deployment of a SailsJS API. My app uses SailsJS v0.11 andsails-mongo 0.11.2.
I have updated config/connections.js to include the connection information to MongoDB database I have hosted for free at…
Sails project is not working. After sails lift command from terminal. I did run the project through the localhost: 1337 port from browser. But its not loading, browser screen is blank. And there is no error message in terminal.
Note: The same…