Hacker News new | past | comments | ask | show | jobs | submit login
Sift.js: mongodb inspired array filting (github.com/crcn)
25 points by crcn on Jan 3, 2012 | hide | past | favorite | 6 comments



Can someone explain me why is it useful? I.e. why not using underscore or whatever library provides map and filter?


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.


It does remind me of an elaboration on map + reduce + filter. Guess I need to finish reading SICP too.


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.


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.


If you could imagine designing Postgres to be more enjoyable and productive to use in the earlier stages, what would you want?




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: