Questions tagged [sails-mongo]

MongoDB adapter for Sails.js

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

400 questions
5
votes
2 answers

How to create 'calculated' fields at Waterline/Sails.js Model?

This is my Users.model: module.exports = { attributes: { name: { type: 'string', required: true, minLength: 3, maxLength: 30 }, username: { type: 'string', …
Marcelo Boeira
  • 860
  • 8
  • 22
5
votes
3 answers

Sails.js & Waterline ORM unset key MongoDB

What method is used to unset a key in MongoDB with Waterline ORM? Consider the following document: { name : 'brian', age : 29 } Getting the user is no problem: var users = Users.findOne({ name : 'brian' }).exec(cb); I would like age to…
brian
  • 2,745
  • 2
  • 17
  • 33
5
votes
3 answers

error:a hook ('orm') failed to load when lifting sails app using mongo DB

I get this error: a hook ('orm') failed to load when trying to lift a sails app using mongoDB. This my connections.js file: module.exports.connections = { mongodb: { adapter : 'sails-mongo', host : 'localhost', port :…
Ebtessam Zoheir
  • 159
  • 1
  • 4
  • 13
4
votes
1 answer

Insert values with different types to MongoDB collection from Node.js

I'm using sails web framework with Node.js and MongoDB to create my own website. Right now, I'm facing some difficulties while trying to create a new user, and insert values (from different types: Number,Array,Object) to my 'users' collection, when…
4
votes
1 answer

Sails v1.0: error while using custom primary key with mongo

I'm giving a try to the beta version of SailsJS (v1.0.0-32) and I'm having some issues while configuring a custom id. Bellow you'll find my current configuration: The modelExample.js module.exports = { attributes: { id:{ type:…
4
votes
1 answer

sails js mongodb populate

I would like to use .populate() with Sails js and MongoDB and so I did something like this: I am using the latest version of Sails and MongoDB and Node. My models look like: // User.js module.exports = { attributes: { name: { type:…
4
votes
1 answer

How to create an authenticated mongo database in a mongo container with minimal config

I'm using Sails 0.12.3 and mongo 3.2.7 Here's my config/connections.js. mongo: { adapter: 'sails-mongo', host: 'database', port: 27017, user: 'user', //optional password: 'password', //optional database: 'db' //optional } and my…
Sebastialonso
  • 1,437
  • 18
  • 34
4
votes
3 answers

How to use { $text : { $search: search } } within sails-mongodb?

I have a sails-mongodb query which is db('insights').find( { $text: { $search: search} } ).limit(limit).skip(offset).exec(function (err, insights) { ... } which give an error of {"name":"MongoError","message":"\"$search\" had the wrong type.…
Keith John Hutchison
  • 4,955
  • 11
  • 46
  • 64
4
votes
1 answer

Count GroupBy in Waterline with sails-mongo

I need to get the count of occurrence of a certain value in a collection, like this: [ {author: 'Diego', name: 'This is a great post', date:'03/13/78'}, {author: 'Raul', name: 'Recipe for success', date:'02/03/99'}, {author: 'Diego',…
Diego Pamio
  • 1,377
  • 13
  • 21
4
votes
2 answers

Deep associations in sails mongo using populate method?

I am new to sails.js and I am using "sails.js with Mongodb". I am having problem with deep associations using populate in my sails app. I have a relationship like this: Category has many to many relationship with Article. City has one to many…
Anil Kumar
  • 187
  • 1
  • 9
4
votes
4 answers

How to use auto increment in sails-mongo

I was just playing around the concepts of sailsjs then I came to know we cannot use auto increments in sails if we are using mongodb as our database. I cannot able to use the auto increments even for the non primary key attributes. Is there any…
Anandapriyan S.D
  • 315
  • 4
  • 15
4
votes
1 answer

Deploying App Sails js Heroku | Application Error

I have a error when I run my app. Application Error. An error occurred in the application and your page could not be served. Please try again in a few moments. If you are the application owner, check your logs for details. The Heroku logs: May…
4
votes
1 answer

Not able to add scripts in layout.ejs (sails.js)

I am trying to add a route.js file in the layout.ejs. Scratchpad
divakar
  • 1,379
  • 6
  • 15
  • 31
4
votes
0 answers

sails js RangeError: Maximum call stack size exceeded on heroku

Am getting this error from my heroku application logs. Same code on my local machine is running perfectly. But not on heroku server, Here is the exact error from the terminal. 2015-02-09T12:00:03.532045+00:00 heroku[router]: at=info method=GET…
4
votes
1 answer

How to count association size with waterline/sails?

Using sails 0.10.5/waterline 0.10.15: I cannot find an answer to a simple question: how to count the elements of an association without using populate() (which would load all data). Let take a simple many2many relation with via: User: …
cwo
  • 41
  • 2
1
2
3
26 27