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