Questions tagged [sails-mongo]

MongoDB adapter for Sails.js

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

400 questions
1
vote
1 answer

Sails-mongo get result between two dates

I am working on sails js with mongodb with sails-mongo adapter , My problem is i cant fetch the result between two dates using sails-mongo. So is there any solution for retrieve this data, actually i want to get total count of each day day's entries…
Nishchit
  • 18,284
  • 12
  • 54
  • 81
1
vote
1 answer

NodeJs sails model replacing existing table

Hello people below is my model code for an user table... module.exports = { attributes: { firstName: 'string', lastName: 'string', age: 'integer', birthDate: 'date', emailAddress: 'email' } }; It is creating user table with the above mentioned…
Your Friend
  • 1,119
  • 3
  • 12
  • 27
1
vote
1 answer

Sails.js associations: "Many" side of one-to-many associations not saving to MongoDB or Postgres (vs. disk db)

This works with sails-disk adapter but not with sails-mongo or sails-postgresql. I have 2 models, Feed and Event, where Feed can belong to many Events. When I create or save a new Feed record with an association to one or more Events (via "posts"…
senornestor
  • 4,075
  • 2
  • 33
  • 33
1
vote
1 answer

How to format the retrieving mongo date in sails framework?

This is my mongo db document { "creatorUid": "1234", "creatorUserName": "userabc", "title": "this is the first thread", "description": "I like this thread and try to read it", "threadOwner":…
gihandilanka
  • 585
  • 6
  • 14
1
vote
1 answer

Sails: ObjectId types without using associations

I'm aware of the association feature of Waterline, however for this specific application I do not want to use it (I don't want the related models returned in my JSON-- I only want their ObjectIds). Is there a way to create a field on my model that…
HolySamosa
  • 9,011
  • 14
  • 69
  • 102
1
vote
1 answer

what is the best way to integrate node_acl with sails

i'd like to use https://github.com/OptimalBits/node_acl module with http://sailsjs.org Framework. So I configured sails to use mongodb like this : In /config/connection.js mongodb: { adapter: 'sails-mongo', host: 'localhost', port: 27017, …
3psilon
  • 135
  • 3
  • 11
1
vote
0 answers

Sails.js + MongoDB - Recommendations for storing users's multiple social account IDs

I'm currently developping a webapp with Sails.js + MongoDB. I'm pretty new to Node.js and NoSQL world so I would like some recommendations. Basically, an authenticated user will have the possibility inside his Dashboard to allow my webapp to…
mr-wildcard
  • 543
  • 3
  • 11
1
vote
1 answer

Sails JS Model Rest API

I'm new to sails.js and find something strange. I have create a model user like : sails generate api user So i have access to : http://localhost:1337/user/ and http://localhost:1337/user/create?name=joe&test=true But why sails allow me to add…
jaumard
  • 8,202
  • 3
  • 40
  • 63
1
vote
2 answers

Why is Model.save() not working in Sails.js?

Save() giving me error like "Object has no method 'save'" Country.update({id:req.param('country_id')},model).exec(function(err,cntry){ if(err) return res.json(err); if(!cntry.image){ cntry.image =…
Nishchit
  • 18,284
  • 12
  • 54
  • 81
1
vote
1 answer

Sails/Mongo Returning ObjectID After Create

I'm at an impasse and I will be the first to admit that this info is more than likely hiding somewhere on the internet. At this point though my google results are just returning the same pages I have been to a dozen times already which leads me to…
Ben
  • 11
  • 1
1
vote
1 answer

Sails.js find by distance from geolocation coordinates

I have been using sails.js on a project which will show posts near a users location, however while I have had no trouble in finding references and tools to geocode an address I cannot find any information on finding these by distance from another…
james0
  • 55
  • 1
  • 9
1
vote
0 answers

Sails Models Default values to Select?

On my project all the tables should have the 'status' atribute, that verify if the record is active, inactive or deleted. So I'll have to select everytime with a "...where status = active". There's another way to do that, just once, and use at every…
Marcelo Boeira
  • 860
  • 8
  • 22
1
vote
0 answers

Waterline / sails-mongo Type _getPK error

I'm working on a table using waterline and I just change on field form string to a relation ship and now when I run it I get the error [Error (E_UNKNOWN) Encountered an unexpected error] Details: TypeError: Cannot read property '_getPK' of…
ginad
  • 1,863
  • 2
  • 27
  • 42
1
vote
0 answers

Multi route, multi template with Sails app

I've been wondering if it would be feasible to create an app similar in functionality to Squarespace where once logged in, a user can create a 'micro-site' choosing hers/his own theme for it. The application would then link the user with a db,…
WagnerMatosUK
  • 4,309
  • 7
  • 56
  • 95
1
vote
2 answers

Sails v0.10.x doesn't respect connection config in production.js when in production mode

What is the correct way to set a db connection in Sails v.0.10.x for production use? I expected Sails to use the connection I referred to in production.js when I start my app in production mode (environment), but it doesn't. It seems to always…
kevinsapp
  • 374
  • 5
  • 11