Question

I'm having trouble getting MongoEngine to accept specific IDs. It seems absolutely determined to use (and only use) ObjectIds. I'm more than able to generate my own IDs in this instance, thanks.

How can I get MongoEngine to play nice?

Was it helpful?

Solution

I managed to solve this by adding the following to the class:

id = mongoengine.StringField(required=True, primary_key=True)

Not sure if this is the "proper" way of doing things, so ill leave this unanswered for a bit.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top