ID mappers

Skip to first unread message

Vincent Le Goff

Apr 30, 2021, 9:27:01 AM4/30/21
Hi everyone,

I just found out about this great project.  I'm working on a small game
engine, but having data problems recently, I was considering whether I
should create an ORM myself, which is a big undertaking, as we probably
all know.  At the same time I was looking at MongoDB in particular, and
Pymongo, because a database with such flexibility felt welcome, but
Pymongo seemed too close to the skin and I wasn't feeling too
comfortable using it.  Now, MongoEngine seems to be a very different
story and from what I've seen, much closer from what I was going.

However, I do have a question for you: does MongoEngine support, perhaps
optionally, an ID mapper?  To illustrate, if I pull twice the same
object from the database, will they have the same identity (id() in
Python)?  This is kind of a requirement for me, because I build a lot of
handlers that are sitting on instances, and making sure these handlers
are replicate if instances don't have the same identity is trickier.  Of
course, I know an ID mapper isn't such a good thing when the data is
shared across multiple applications, but that won't be my case,
everything goes through the same pipeline (and, if possible, the same ID
mapper). Does this system exist in MongoEngine?  Or, if not, can I had
it without too much work?

Thanks in advance,


Reply all
Reply to author
0 new messages