query using mongoengine instead of forming json using python