MongoDB for Developers with Python Transcripts
Chapter: Mapping classes to MongoDB with the ODM MongoEngine
Lecture: Welcome to mongoengine

Login or purchase this course to watch this video and the rest of the course contents.
0:01 So here we are at mongoengine.org and MongoEngine is the document object mapper, right
0:07 they say think ORM but for document databasis, right just like we said, and MongoEngine is a great ODM, which they maybe call it DOM,
0:16 given their naming, I think ODM is slightly more popular; anyway, it's really great and flexible ODM,
0:21 it has a very clear way of describing your classes, if you use something like SQLAlchemy and you like the way it works,
0:27 you really like this, if you like Django ORM it's very similar to that, actually it uses the active record style, not the unit of work style
0:35 which Django uses active record, so does Ruby On Rails, if you look as opposed to say SQLAlchemy which uses unit of work.
0:42 It works well in Python 3, it also works in Python 2. So if you go here you'll see there's actually additional things you can get,
0:49 you can get a Flask plug in on top of this, you can get a Django plug in on top of this,
0:53 and some extras as well, there's a couple of cool additions that you get, but we're just going to work with plain MongoEngine,
1:00 that means we can use it in any application whether it's a web app or not and we can use it however we want in our web application.
1:07 Like pretty much everything in this course MongoEngine is open source so you can go here to githug mongoengine/mongoengine,
1:13 you can see it's almost two thousand stars, almost a thousand forks, it was updated fourteen days ago, it's very active and living project,
1:19 it's one of the things I look for when I depend on some core part of my application is is this thing being updated, is it alive, things like that,
1:29 you don't want to take on something as critical as your object document mapper if no one is out there maintaining it,
1:35 you probably don't want to be writing an ODM, you probably want to be using ODM and building whatever it is you're trying to build,
1:41 like a website or app, or a service api, whatever, it's probably not an ODM you want to be building. So you see, MongoEngine is quite active,
1:49 and you can go fork it and keep a copy of it for yourself, but for this course, we're just going to pip install it.


Talk Python's Mastodon Michael Kennedy's Mastodon