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…
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 :…
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…
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:…
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:…
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.…
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',…
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…
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…
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…
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…
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:
…