Questions tagged [waterline]

Waterline is an adapter-based ORM for Node. It is included with the Sails.js framework.

Waterline provides a uniform API for accessing stuff from different kinds of databases, protocols, and 3rd party APIs. That means you write the same code to get users, whether they live in MySQL, LDAP, MongoDB, or Facebook.

At the same time, Waterline aims to learn lessons and maintain the best features from both Rails' ActiveRecord and Grails' Hibernate ORMs.

Waterline uses the concept of an Adapter to translate a predefined set of methods into a query that can be understood by your data store. Adapters allow you to use various datastores such as MySQL, PostgreSQL, MongoDB, Redis, etc. and have a clear API for working with your model data.

It also allows an adapter to define it's own methods that don't necessarily fit into the CRUD methods defined by default in Waterline. If an adapter defines a custom method, Waterline will simply pass the function arguments down to the adapter.

Project GitHub


Related tags :

1230 questions
0
votes
1 answer

Multiple chained promises is sailsjs

This is my first attempt at attempting to chain multiple finds together. The debug running shows that all the code executes correctly but there is a delay in receiving the users array back and therefore unable to present the data back. The concept…
user2356169
  • 73
  • 2
  • 7
0
votes
0 answers

waterline ORM, what does the find() query return?

I'm using the sails-mongo adapter to connect to my local mongodb server. I have one model, that is Users.js and I'm trying to find the user with a specific ID. User.findOne({userID:authID}).exec(function(error, found){ console.log(typeof…
Rockstar5645
  • 4,376
  • 8
  • 37
  • 62
0
votes
2 answers

Is there a bettery way to work with nested(associated) models in Sails JS?

I've connected my SailsJs app to a Mongodb database. I'm working on an analytic application. These are the major models in my application: User Project Report Event A user can have many projects, a project can have many reports and a report can…
Iman Mohamadi
  • 6,552
  • 3
  • 34
  • 33
0
votes
2 answers

Sails.js / Waterline: How do I use a collection attribute in a find query?

I am working on a Waterline query which filters objects by a collection attribute. In this simplified example, I have two models, Video and Category: // Video.js module.exports = { attributes: { title: { type: 'string' }, …
Andi S.
  • 163
  • 2
  • 11
0
votes
3 answers

sails waterline sort on number not working(sails-redis)

I am trying to do sort id Modal: module.exports = { autoPK: false, attributes: { id: { type: 'integer', autoIncrement:true, primaryKey: true }, } } Query: mymodal.find().sort({id:…
Max
  • 71
  • 9
0
votes
1 answer

Sails.js - Waterline Model - Association to itself

I want to create a Tree like storage structure to be used with my app, but can't find enough documentation on how to create a tree model using Waterline attributes. Case is simple. I do need to have a set of folders, that can have multiple levels…
afterxleep
  • 622
  • 1
  • 5
  • 17
0
votes
1 answer

Sails.js - Node.js - [ReferenceError: Promise is not defined]

I have inherited a half-complete project (app) developed in Angular/Sails/PostgreSQL I have no previous experience of Angular, Sails.js, or PostgreSQL The app works on live, and is currently running, and several important users are using it. This…
0
votes
1 answer

TypeFramework Relationships

I have been playing with the TypeScript MVC framework TypeFramework and am trying to figure out how to create relationships between models. I know it uses the Waterline ORM. An example of a Waterline model with a relationship is: // A user may have…
BSmith
  • 123
  • 8
0
votes
1 answer

how to install sails auth for manually configured mongoose ORM

Hi i removed waterline ORM from Sails JS and added mongoose, for that i followed the steps specified in the following link http://laurentschaffner.com/blog/from-waterline-to-mongoose-in-sails/ But now am facing issues in installing sails-auth…
Nikhil Mk
  • 151
  • 10
0
votes
2 answers

SailsJS populate blueprint routes not working on Windows

I am new to sails.js and I am attempting to get up to speed on the API built-ins. I have an authenticated API up and running for a sample library app that I am building. The app is pretty simple. I have a Book model that contains the relevant book…
Jason
  • 31
  • 6
0
votes
0 answers

How to create a one-way one to many relationship in SailsJS?

I'm trying to create a unit model, that has many objectives. The user will be able to create their own units. Each objective will already be determined, they'll simply be chosen by the user to make up the unit. The objectives, therefore, will not…
rjoxford
  • 351
  • 3
  • 12
0
votes
1 answer

Sails.js : findOne() works but not find() in Waterline

I am developing a sails.js app with MySQL. I have a model, for which create and retrieve work without any problems. Model.findOne({ where: { someAttribute : 'foo' }, function(err, model) { // some logic }); works fine, but not Model.find({…
Jaseem Abbas
  • 5,028
  • 6
  • 48
  • 73
0
votes
1 answer

Where criteria is not working on populate in waterline

I am using waterline and waterlinhe-orientdb. I have user and order vertex classes and bought edge class User ---Bought-->Orders I am trying to apply Where criteria on populate. But is not working on populate. Here is my code var CREDIT_CARD = 1;…
9me
  • 1,078
  • 10
  • 36
0
votes
1 answer

Waterline Lifecycle Callbacks not get invoked

I'm currently running Sails.js v. 0.11.0 and Waterline v. 0.10.0b. I have a user model with two lifecycle callbacks that do not get invoked when I destroy the user. I tried user.destroy() as well as User.destroy(id). Should I explicitly call those…
Kuba
  • 2,069
  • 23
  • 30
0
votes
1 answer

SailsJS & Waterline - Change models connections dynamically

I'm currently working on a project (SailsJS 0.11) with different databases. All my users have different read permissions on those databases. For example : I have two databases DB_A and DB_B There are two users USER_A and USER_B USER_A has only the…
fwoelffel
  • 412
  • 7
  • 16