human
Get required fields from Document in mongoengine?
assistant
Here is some code to get a list of all fields in class `User` that are marked `required`

[k for k, v in User._fields.items() if v.required]

#Warning: this code generation is experimental. Please inspect the code for any bugs before executing.