Exemplo n.º 1
0
 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'])
Exemplo n.º 2
0
 def get(self, _id=None):
     return get_records(col_clothType, _id, ['categoryId'])
Exemplo n.º 3
0
 def get(self, _id=None):
     return get_records(col_designers, _id)
Exemplo n.º 4
0
 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)
Exemplo n.º 6
0
 def get(self, _id=None):
     return get_records(col_occassionType, _id, ['categoryId'])
 def get(self, _id=None):
     return get_records(col_designerProductRelation, _id)
Exemplo n.º 8
0
 def get(self, _id=None):
     return get_records(col_backViewType, _id, ['categoryId'])
Exemplo n.º 9
0
 def get(self, _id=None):
     return get_records(col_users, _id)
Exemplo n.º 10
0
 def get(self, _id=None):
     return get_records(col_tailors, _id)
Exemplo n.º 11
0
 def get(self, _id=None):
     return get_records(col_category, _id)