added export function, only tested on mongoengine