Questions tagged [waterline]

Waterline serves as a Node-based ORM that operates with adapters, making it an essential component integrated within the Sails.js framework.

The $pull functionality of Waterline ODM used to query and update a MongoDB database

The Waterline feature of Sails allows you to designate an entity's attribute as an 'array' type: module.exports = { attributes: { items: { type: 'array' } } } In MongoDB, the $pull operator is available for update queries, enabling the removal ...

Having trouble with the command "npm install sails-mongo --save"?

When attempting to include sails-mongo in my Sails project by running npm install sails-mongo --save, I encountered the following error: ~/newWebApp $ npm install sails-mongo --save npm ERR! Linux 3.13.0-24-generic npm ERR! argv "node" "/usr/bin/npm" " ...

What are the methods for implementing calculated fields in Waterline for the purpose of sorting?

I'm currently working on sorting my query for the Reddit hot algorithm. The sorting is based on time, and unfortunately I am unable to use beforeUpdate or beforeCreate hooks in this case. I need to incorporate a calculation while querying, but so far I hav ...

Incorporate DynamoDb functionality into your Sails js application

Recently, I embarked on a project using Sailsjs with DynamoDB as the database. During my research, I came across a helpful package at https://github.com/dohzoh/sails-dynamodb. The documentation provided detailed instructions for the initial setup. After i ...

Sails.js's powerful full text search capability

Can Sails.js and/or Waterline support full text search? While PostgreSQL does support full text search, it appears that the PostgreSQL adaptor for Waterline may not have this feature. Is an efficient full text search achievable with Waterline's cont ...

Having fun with node.js in a boat sailing through the digital waters of sails.js, guided by the

Currently, I am attempting to understand how promises function in sails. So far, I have been successful in passing data from waterline queries using .then, however, I have run into an issue when trying to use .spread. Specifically, I am receiving a 'f ...

Having trouble with npm not installing the most recent version from GitHub?

After working with a module named 'sails-mongo,' I am trying to upgrade it to the most recent version using the command below: npm update sails-mongo --save I have also attempted uninstalling and reinstalling. I experimented with sails-mongo@latest and s ...

What is the best way to differentiate between a JSON object and a Waterline model instance?

Note: I have posted an issue regarding this on the Waterline repo, but unfortunately, I have not received a simpler solution than my current workaround. Within my User model, along with default attributes such as createdDate and modifiedDate, I also have ...

How to retrieve the count of documents in a populated collection using Sails.js with MongoDB

I have two models category and inventories and they are associated. The command I used is: Category.find(query).populate('inventories',{select: ['id']}); This command returns the following result: "categories": [ { "inventories": [ { ...

Searching the JSON file by its value using Waterline

I am struggling with locating model instances based on the nested address attribute in one of my models. attributes: { address: { type: 'json' } } I have attempted various queries to find model instances located in the same city: Model.find({ "a ...