News for hackers. Stuff that matters.
Re:Sift.js: mongodb inspired array filting by phzbOx on Tuesday January 03, 2012 @03:29PM (#3421174)
Can someone explain me why is it useful? I.e. why not using underscore or whatever library provides map and filter?
Re:Sift.js: mongodb inspired array filting by crcn on Tuesday January 03, 2012 @05:14PM (#3421564)
Thanks for the feedback. I'll add a few use-cases / examples to the project page.

Here are a few good examples which use sift:

- Realtime API library: https://github.com/crcn/guava

- Simple database written in node.js: https://github.com/crcn/gumbo. I use this primarily in command line utilities, and other applications where mongodb seems a bit over the top.

Underscore is certainly a better alternative in many cases, but the goal for sift is to provide control over filtering collections with one query versus manipulating them.

Re:Sift.js: mongodb inspired array filting by dpritchett on Tuesday January 03, 2012 @06:29PM (#3421836)
It does remind me of an elaboration on map + reduce + filter. Guess I need to finish reading SICP too.
Re:Sift.js: mongodb inspired array filting by dpritchett on Tuesday January 03, 2012 @03:25PM (#3421160)
The first 90% of my current pymongo-backed project was great, I just came up with whatever schemas I wanted and inserted the data as serialized JSON-style objects.

The second 90% has been not so great... I spend my time either doing in-place serialized batch updates to correct my own early schema mistakes or (mostly) reinventing SQL so that I can join my schemas arbitrarily and dump them to CSV per user requests.

I hope this means I'm just doing it wrong. Time to dig my Mongo book back out.

Re:Sift.js: mongodb inspired array filting by Pewpewarrows on Tuesday January 03, 2012 @04:24PM (#3421350)
Nope, unfortunately that's what I'm running into as well. A blissful start of the project with no schemas to tie it down or hold it back. Now that it's starting to require migrations, join-like behavior, and complicated queries, I really just wish I had my trusty old PostgreSQL back. I swear, if I have to write one more set of map/reduce functions just to do anything non-trivial with this database I'm going to end up hurting a small animal.
Re:Sift.js: mongodb inspired array filting by fdr on Tuesday January 03, 2012 @07:26PM (#3422047)
If you could imagine designing Postgres to be more enjoyable and productive to use in the earlier stages, what would you want?