SHARE
TWEET

MONGO AGGREGATION FRAMEWORK

a guest Sep 26th, 2019 103 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. @app.route('/seepati', methods=['POST', 'GET'])
  2. def seepati():
  3.     if 'username' in session:
  4.         muser = session['username']
  5.         b = mongo.db.b
  6.         pipeline = b.aggregate([
  7.             {'$match':{'username': muser}},
  8.             {'$lookup':{'from': 'a', 'localField': 'username', 'foreignField': 'username', 'as': 'arranjofinal'}}
  9.             {'$sort':{'username': 1}}
  10.         ])
  11.         return pipeline
  12.     return render_template('index.html')
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top