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
3 answers

sails 0.9.8 not work, when created controller and lift it

I have a problem with sails 0.9.8. I already installed sails on my mac and also lift, it work well, but when start generate controller and model then start lift command again it show some error like: $sails…
0
votes
1 answer

WaterlineJS find all not in ($nin)

I'm using the Waterline ORM (MongoDB adapter) with SailsJS and trying to return all documents that don't match the specified query along the lines of this: User.find({ id: { $nin: [array] } }).done(...) I understand that when…
btown
  • 33
  • 4
-1
votes
1 answer

How to specify function to use using an object in JS

I am trying to build a function that allows users to retrieve data from the database, but in a dynamic way. So allowing them to specify the source table, as well as which columns they would like to retrieve. I have already built out the part that…
TreyCollier
  • 181
  • 1
  • 12
-1
votes
1 answer

Need solution to search case insensitive fields, REACT, sailis , mongodb

Adapter i am using is adapter: "sails-mongo", I am trying to query for matches, example: Assume Values in DB for field (name) are JOHN , John, JohN , john, JOhn martin If i search with a query for name="john" results should JOHN, John, johN In the…
-1
votes
1 answer

Nesting objects in SailsJS models

how to put the full object workstation in another object userWorkstationSchedule? code: Workstation.js module.exports = { tableName: 'workstation', attributes: { name: { type: 'string', required: true, maxLength: 100, columnType:…
comodo
  • 1
-1
votes
1 answer

Make native query in standalone Waterline

When trying to use Waterline standalone mode, I could not find the correct method to perform native queries. With Sails.JS the sendNativeQuery method is used which I could not find in the instances of the models. Does anyone know how I can perform…
dragons0458
  • 143
  • 1
  • 6
-1
votes
2 answers

How to implement inner join in sails waterline

// model Users.js that is the users model: module.exports = { autoCreatedAt: false, autoUpdatedAt: false, tableName : 'users', attributes: { user_id: { type: "string", primaryKey: true }, name : { type :…
Abdul Jabbar
  • 124
  • 1
  • 7
-1
votes
2 answers

WaterlineJS/SailsJS: Query array attribute contains a value

Suppose I have a model attribute tags: ['tag1', 'tag2', 'tag3']. I want to find models that have a certain tag. How do I do it? It appears contains does a string contains. Not array contains which I need?
Jiew Meng
  • 84,767
  • 185
  • 495
  • 805
-1
votes
1 answer

Node.js waterline-orientdb update fail

I am trying to create a simple server application in Node.js using the waterline-orientdb package where there are several users who can invoke several methods. Before a user can do anything, the user needs to authenticate with his username and…
Cerebres
  • 343
  • 3
  • 16
-1
votes
1 answer

Can a Waterline model access its collection in life-cycle events?

I have a model where only one record can have a 'current' property set to, for example, 1. Is it possible for the beforeCreate or beforeUpdate to access the collection. Basically I want to do something like this: afterUpdate: function (values, next)…
Andrew Eddie
  • 988
  • 6
  • 15
-2
votes
1 answer

Waterline relations in SailsJS

I write an application in SailsJS and i have a problem with relations, some code at the beginning: User.js module.exports = { tableName: 'user', attributes: { schedules: { collection: 'userworkstationschedule', via: 'user'…
henry123
  • 17
  • 2
-2
votes
1 answer

Data not returned from custom collection

I have a hand-made collection (mymodel) in MongoDB. I have created a sails model+controller using 'sails generate api mymodel' I am now trying to use the sails find() method using the REST api: http://localhost:1377/mymodel, but I do not get any…
user1749672
  • 116
  • 1
  • 8
-2
votes
1 answer

sailjs search in many to many

have 2 models with many to many assoc(MongoDB). How I can find in assoc. EXAMPLE USER MODEL name: { type:'string' }, groups:{ collection:'Group' via:'users' } GROUP MODEL name:{ type:'string' }, users:{ collection:'User', via:'groups' } how I can…
Eugene
  • 69
  • 1
  • 8
-3
votes
2 answers

sails.js " 1 attribute is invalid" "code": "E_VALIDATION", "invalidAttributes"

i havge some trouble with the sails.js framework. i have some issue with invalidattributes with this waterline and sails.js framework. how ever try this nerving this to fix it. but no change.. i dont know where the problem is... and its very crash…
Pueblo
  • 1
  • 2
-4
votes
1 answer

is there any way to convert mongodb database to waterline db?

I have a one file which has details of the database named xyz.js and another file which created the database using that file in mongodb and also has various functions like adding to database etc.The name of this file is create.js. Now I want to…
me_aj
  • 1
  • 1
1 2 3
81
82