Closed iebb closed 3 months ago
As you pointed out, id is kind of an alias for _id in MongoEngine and I don't have a workaround (and don't think it's such a common scenario to develop one)
One thing you can consider is to use your django style integer as id
class YourDoc(Document):
id = IntegerField(primary_key=True)
...
Migrating from Djongo here, and my current data involves - _id: the automatic ObjectId field id: Django-style integer field with a unique index.
As I want to maintain compatibility between Djongo model and MongoEngine, and since MongoEngine relies heavily on the 'id' field, what's the current best practice for MongoEngine to maintain both?