ChrisWorks
ChrisWorks

Reputation: 207

SailsJS + Waterline + MongoDB - Should I stop using?

I am concerned that SailsJS + Waterline + MongoDB is not a winning combination anymore. Our application is using "Waterline Associations" more and more and I find its functionality is limiting my application.

I want to find by association, which does not seem possible. I can only populate with subcriterias, but that does not help as it does not exclude the entries that does not match the subcritera.

E.g:

Document.find({type: 'pdf'}).populate('owners', {where: { name: 'contains' : XYZ }).exec(...

The result from the above query gives me ALL documents with type: pdf. That is NOT what I need. Any good way to solve this?

Also case-insensitive queries seems impossible?

So ... should I start looking towards something else? or am I missing something completely?

Upvotes: 0

Views: 445

Answers (1)

Manuel Reil
Manuel Reil

Reputation: 508

We are using sails.js, Waterline and MongoDB for almost 2 years in production. The association part is really not well suited and we will develop something for the associations (especially many-to-many) on top of Waterline on our own.

To your questions:

  • I propose to flip the 2 models:

Owner.find({ name: 'contains' : XYZ }).populate('documents', {where: {type: 'pdf'}).exec(...

  • You can do wlNext: { caseSensitive: true//false } in the adapter. See this issue

Upvotes: 0

Related Questions