1602/express-on-railway — Issue #105: documenting schema / model format
Author: pctj101
Created: 2012-01-23 06:19:22+00:00
State: open

Hi,

Just a friendly suggestion. Right now there are lots of files in /app/models/model.rb

However railway and jugglingDB do a fair amount of magic, and it's unclear what I'm modifying or even how.

Since JugglingDB abstracts away my DB knowledge of the underlying mongoose schema, I'm now working with a JugglingDB model. How do I extend it? By prototype? By a JSON hash? I could go decypher the code, but at that point, I'd rather just use straight mongoose (personal opinion of course).

Juggling DB makes it nearly impossible to know the right way of storing ObjectId from mongodb. Yes it's an abstraction, but I feel we forgot to abstract the ObjectId concept because not everything fits in to the hasMany/belongsTo constructs. So I want to document the existence of a field I''m using in schema.js, then implement my own finders. Currently using datatype mongoose.Schema.ObjectId, at which point, I'm losing the DB Abstraction.

Juggling DB makes it hard to do nested attributes in documents. So a model like { x { y: { z: [1,2,3] } } } is nearly impossible. I'd like to just access the mongoose object underneath while juggling DB figures this out, but the underlying mongoose/schema is entirely abstracted to oblivion.

And why is this in railway? Well... my current uneducated opinion is that nobody would want to use JugglingDB outside of railway. And a lot of how JuggingDB is configured is initiated through railway. Kind of like how ActiveModel is little used outside RoR despite being abstracted.

Anyways, I'm totally cool if someone says, "good feedback, off topic" and just puts todo thoughts where they really belong. No need to track progress through this issue. I'm just putting down my thoughts. :)

Thanks!