Does Meteor have a concept for clearly defined data models?

So, today was my second day of training Meteor.js - reading documentation, watching videos, etc. .... What I have not seen so far was a strong concept of the model, so it will be used in most other JS- infrastructures. For example, if my Meteor application was to contain a list of people, I would declare the People collection and subsequently add / update / delete entries. This is different for me from creating a Person object, setting its properties, adding this object to a collection of other Person objects, etc. Is my initial perception correct, and Meteor really does not have this paradigm of modeling business objects, what do the other frameworks do?

+7
meteor
source share
2 answers

Check out the atmosphere-friendly package.

0
source share

Yes, that's right. This is parallel to the schematic nature of MongoDB, unlike RDBMSs, where your data tables have a clearly defined schema. Here is a quote from Meteor docs under new Meteor.Collection() :

Calling this function is similar to declaring a model in a traditional ORM (Object-Relation Mapper) -centric structure.

However, Meteor does not stop you from implementing your more complete model system on top of your existing collection system. There are quite a few third-party packages on atmosphere.meteor.com that try to do this. The transform parameter in Meteor collections provides a good starting point for creating a model layer, which allows you to add behavior and virtual fields to documents when they are retrieved from the database.

Here in the future we plan to create a roadmap showing that models, schemes, validators and migrations are planned in the future for Meteor. This is important for future SQL support . However, for 1.0, they are trying to release a stable, thin kernel built on top of MongoDB . The MDGs are no doubt observing the implementation of the current model in the atmosphere for inspiration to create their own core implementation later. Jeff Schmidt briefly dwells on this in the Getting Meteor 1.0 video.

TL; DR: Meteor provides the basic, necessary APIs needed to implement models for MongoDB, but you want to. A clearer official data entity system and SQL support are planned for the future, but at the moment you can use third-party solutions in the atmosphere or minimize your own.

+8
source share

All Articles