def get(self, _id=None): pipeline = [ { "$lookup": { "from": "categorys", "localField": "categoryId", "foreignField": '_id', "as": "categorys" } }, { "$unwind": { "path": "$categorys", "preserveNullAndEmptyArrays": True } }, {"$group": {"_id": "$_id", 'categoryId' : {"$first":'$categoryId'}, 'categorys' : {"$first":'$categorys'}}} ] cursor = col_frontViewType.aggregate(pipeline) pprint.pprint(list(cursor)) # return jsonify([]) return get_records(col_frontViewType, _id, ['categoryId'])
def get(self, _id=None): return get_records(col_clothType, _id, ['categoryId'])
def get(self, _id=None): return get_records(col_designers, _id)
def get(self, _id=None): return get_records(col_products, _id, [ 'categorys', 'designerId', 'frontTypes', 'backTypes', 'occassionTypes', 'clothTypes', 'bodyTypes' ])
def get(self, _id=None): return get_records(col_tailorProductRelation, _id)
def get(self, _id=None): return get_records(col_occassionType, _id, ['categoryId'])
def get(self, _id=None): return get_records(col_designerProductRelation, _id)
def get(self, _id=None): return get_records(col_backViewType, _id, ['categoryId'])
def get(self, _id=None): return get_records(col_users, _id)
def get(self, _id=None): return get_records(col_tailors, _id)
def get(self, _id=None): return get_records(col_category, _id)