Hello,
I believe you should be able to set a different field as your primary key. For example try:
class MyDocument(Document):
id = DynamicField(primary_key=True, db_field="_id")
That should let you store any type of value as the ID if you’re only interested in querying the data. It would probably be a better idea to create a proper Field type for your primary key and add a custom validator.
Hope this help!
Matthew Ellison
--
You received this message because you are subscribed to the Google Groups "MongoEngine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mongoengine-us...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.