I have two collection 1) ram 2) details. find the below pic for your reference.RAM collection details
In the lambda function, when i passed the rank in event, we will get the output the related rank. but i need more details in the same output.
Eg: when i passed the rank event 10002, then we will get the rank 10002 relevant data display. but i need along with user details like ramesh, suresh
details from details collection.
def lambda_handler(event, context):
print("Received event: " + json.dumps(event, indent=1))
posts = db.user_posts
rankid = event['rank']
disposts = list(posts.find({"rank" : rankid}))
posts = json.dumps(disposts, default=json_util.default)
return json.loads(posts)
In this above code, i will get only one collection data. I need both collections data on same lambda function.
My expected output like this below.
rank : 10002,
details:
0 : Object
username : "ramesh",
des : "developer",
edu : "b.tech",
age : 25
1 : Object
username : "suresh",
des : "admin",
edu : "mba",
age : 27
not exactly, i need the output similar.
Can you please help me out with the proper code. Thank you