0

Can anyone recommend a library that provides an ORM-like framework for Riak/Node.js that is similar to Mongoose for MongoDB?

I've checked out Riak-js (http://riakjs.org/) but it doesn't seem to provide a way to define a model like the following:

var user = new User();
user.created = new Date();
user.username = "TEST";
user.password = "PASS";
user.email = "someemail";
user.save();

I checked out the great Tubbs (riakjs-model) library but doesn't seem like it's active.

Cliff F
  • 381
  • 6
  • 14
  • So after doing some research, I found out about jugglingDB, which is basically a multi-database ORM. There is also a Riak adapter being written for this. I will try this out and post my findings on here. – Cliff F May 16 '12 at 18:47

2 Answers2

0

I found it best to roll my own mapper on top of the raw driver. The current drivers can obfuscate what's going on a bit, not to mention that when you're writing Map/Reduce-based queries, it gets really hard to debug what the hell you did wrong.

I'm speaking from experience, trying first to use Ripple (ODM for ruby) and then just ripping it out and using the riak-ruby driver.

Srdjan Pejic
  • 8,152
  • 2
  • 28
  • 24
  • Yes, that's exactly the problem I was running into - where the drivers available were making it difficult to see what was going on, especially with map/reduce queries. Also, I'm concerned that an ORM will make interfacing with Riak slower, so it might be better to talk to Riak directly. – Cliff F May 16 '12 at 21:15
  • Yeah, most of the implementations are still rough around the edges, especially the map/reduce ones. Talking to the driver directly and building abstractions around is probably better right now. Also, when you're certain your m/r functions work, push them straight into riak ala Riak.mapValueJson. – Srdjan Pejic May 17 '12 at 15:40
  • Thanks Srdjan - I guess the Riak ecosystem is still fairly new compared to the other NoSQL. In the mean time, rolling my own mapper is the most likely the best solution right now like you said. – Cliff F May 17 '12 at 17:36
0

what about this one "ts-mongodb-orm"

https://www.npmjs.com/package/ts-mongodb-orm