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