On Tuesday, 25 September 2012 at 10:26 PM, Daryl Antony wrote:
Hi there.I'm stepping into the meteor/mongo world, coming from django/rdbms/django models and 'south' schema and data migrations... and so, am trying to loosen my thinking to fit in.I have a few questions:
- Will Meteor have 'models' (I've seen mention of them)?
- will these models be defined with 'fields'? (I've used Backbone recently, consuming an API -- the JSON structure dictated the 'field' structure of the 'backbone model' -- yet, how might this be done in Meteor? (i.e. when the datastore is mongodb which is being 'told' by the Meteor application, how to store data.
- I've seen mention of an upcoming Meteor ORM.
- To me, an ORM can be a scheme to relate objects to one another, like 'Shop has many Products' (similar to 'backbone-relational' perhaps...
- What does ORM mean in the Meteor/Mongo context?
- How might we manage changes in data structure or schema?
- Say we have a whole lot of Products (stored as Mongo documents) with a field 'name' -- and we want to change it to 'title'. Is there a way to 'migrate' the data structure -- similar to which we might do with Django's South?
PolymorphismI've been working on a 'cart/ecommerce' project in django, using django-polymorphic and referencing the REA (Resources, Events, Agents) accounting model, such that (python):class Resource(PolymorphicModel):#...class Product(Resource):#...class Book(Product):isbn = models.CharField()class Food(Product):per_kg_price = ....... and so on.I'm looking to replicate this inheritance in my Meteor project, and associated 'duck typing' -- how might this be possible in Meteor?
On Wednesday, 26 September 2012 at 1:54 PM, Daryl Antony wrote:
Thanks Tom. Great to get the discussion going.ORMI suppose, and I've done this in a meteor test project somewhat, I'm looking to do things like:Carts = new Meteor.Collection('carts')CartItems = new Meteor.Collection('cart_items')Products = new Meteor.Collection('products')cart = Carts.findOne({'user': 'daryl'})cart.cart_items> an array of CartItem 'documents'product = cart.cart_items[0].productproduct> "Apple" // a Mongo "Products" Documentproduct.parent> "Resource: Apple" // a Mongo "Resource" document that is the parent of Product.Perhaps it doesn't matter how its stored by mongo -- just that it is.If this is an 'incorrect' way to use mongo/meteor -- how might I construct something like a 'cart' that has 'cart_items' ?
Is this what an ORM is? Just a means to map object relationships to one another? Or is it more a term tied to an underlying RDBMS?
PolymorphismYes, I've investigate this in terms of JS... and all seems doable -- its more that, how do work with these structures in terms of Meteor collections/documents:Animals = new Meteor.Collection('animals')Dogs = new Meteor.Collection('dogs')
--
You received this message because you are subscribed to the Google Groups "meteor-talk" group.
To view this discussion on the web visit https://groups.google.com/d/msg/meteor-talk/-/yA6nzkxvsVAJ.
To post to this group, send email to meteo...@googlegroups.com.
To unsubscribe from this group, send email to meteor-talk...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/meteor-talk?hl=en.
--
You received this message because you are subscribed to the Google Groups "meteor-talk" group.