Questions tagged [sails-mongo]

MongoDB adapter for Sails.js

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

400 questions
2
votes
1 answer

want to perform join query in sails js in inventory and category model (mongodb)

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…
2
votes
0 answers

Sails/ Waterline: Ids of associations in query result not accessible without populate

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…
Manuel Reil
  • 508
  • 2
  • 10
2
votes
2 answers

How to do a very large query on sails-mongo?

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…
Gustavo Garcia
  • 1,905
  • 1
  • 15
  • 27
2
votes
2 answers

How to Query Friends Posts In Rest API for a specific Route

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…
2
votes
1 answer

Sails.js waterline destroy "lower or equal" criteria

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() }},…
alexmngn
  • 9,107
  • 19
  • 70
  • 130
2
votes
1 answer

Sailsjs - Prevent non-model fileds to be saved in mongo document

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,…
OmriToptix
  • 1,219
  • 1
  • 15
  • 22
2
votes
1 answer

Sails.js more database connection

Blockquote i will planing use more database on same models on sails.Just wanna change db on progress.How can i do it on sails configure
ERKA
  • 23
  • 4
2
votes
1 answer

Sails.js 'schema: true' equivalent for response JSON

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…
leejt489
  • 615
  • 6
  • 13
2
votes
1 answer

Upsert in waterline ORM (Sails.js)

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,…
Mandeep Singh
  • 7,674
  • 19
  • 62
  • 104
2
votes
1 answer

500 internal server error in sailjs

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…
Rahul Saxena
  • 465
  • 4
  • 15
2
votes
1 answer

SailsJS relations not working as expected

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:…
mahadazad
  • 541
  • 5
  • 19
2
votes
1 answer

how to configure node-pushserver in sails js?

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…
2
votes
0 answers

one way direction, sails and mongodb

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: { …
Spiiff77
  • 55
  • 9
2
votes
1 answer

SailsJS deployment to Heroku, connect to Mongolabs MongoDB

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…
Zach Cook
  • 604
  • 12
  • 33
2
votes
0 answers

Sails Project is Not Working

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…
Prem
  • 630
  • 2
  • 11
  • 25