here is my python code:- from flask import Flask, request, jsonify
from pymongo import MongoClient
from bson import ObjectId
app = Flask(name)
MongoDB connection setup
client = MongoClient(‘mongodb+srv://admin:password@cluster0.kuetlkb.mongodb.net/user_data’)
collection = client[‘user_data’][‘user_data_table’]
@app.route(‘/search’, methods=[‘GET’])
def search():
# Get the query parameters from the request
query = request.args.get(‘query’)
path = request.args.get(‘path’)
# MongoDB aggregation pipeline to perform text search
result = collection.aggregate([
{
'$search': {
'index': 'test',
'text': {
'query': query,
'path': path
}
}
}
])
# Convert the MongoDB cursor to a list of dictionaries
search_results = list(result)
# Convert ObjectId to string for JSON serialization
for result in search_results:
result['_id'] = str(result['_id'])
return jsonify(search_results)
if name == ‘main’:
app.run(debug=True) and this the search result i am getting for one path/parameter/column:- {
“PHD_institute”: “”,
“_id”: “653eacd01d5de13ea382a07f”,
“any_entrepreneurship_experience”: “”,
“application_ID”: 215,
“applied_job_ID_list”: “c44824f5-c834-407f-8aa8-e520c12c0abe, 8c6c7e68-16a8-41c9-b135-2c7b847419a4, 8bacb230-3d65-4386-b76c-8f200cc576a2, e07c9236-2468-4fb7-a82d-f622111bb56e, 8296a9d5-3268-40e0-afb5-a7438582602c, aa1af08f-9303-41e2-a299-43695d4b9e45, 2d6c8028-0a12-403a-8e69-b3f”,
“blog_or_articles”: “”,
“candidate_age”: 0,
“college_clubs”: “”,
“current_city”: “Noida”,
“current_country”: “”,
“current_country_code”: “”,
“current_employer”: “”,
“current_role”: “SDE”,
“current_salary”: “0”,
“current_state”: “”,
“current_status”: “APPLIED, APPLIED, Rejected, APPLIED, APPLIED, SCREEN SELECT, INTERVIEW, REJECTED, REJECTED, REJECTED”,
“current_zip_code”: “”,
“date_of_birth”: “0000-00-00”,
“department”: “”,
“diploma_institute_college”: “”,
“diploma_qualification”: “”,
“diploma_year_of_completion”: 0,
“discord_profile_link”: “”,
“email_ID”: “”,
“expected_salary”: “0”,
“facebook_profile_link”: “”,
“field_of_PHD_or_research_paper”: “”,
“full_name”: “Sunil Kr G”,
“gender”: “”,
“git_account_link”: “”,
“govt_ID”: “”,
“govt_ID_Link”: “”,
“hackathon_date_list”: “”,
“hackathon_technology”: “”,
“hackathon_with”: “”,
“highest_qualification”: “”,
“hobbies”: “”,
“industry”: “”,
“instagram_profile_link”: “”,
“institute_list”: “”,
“is_actively_searching”: 0,
“is_serving_up_notice_period”: 0,
“language”: “”,
“last_working_day”: “1969-12-29”,
“level_of_certification”: “”,
“linkedin_profile_link”: “”,
“location_of_hackathon”: “”,
“marital_status”: “”,
“name_of_hackathon_participated”: “”,
“notice_period”: 0,
“other_skills”: “”,
“past_employer_list”: “WUElev8”,
“patent”: “”,
“pg_college”: “”,
“pg_education_type”: “”,
“pg_qualification”: “”,
“pg_year_of_completion”: 0,
“preferred_city_location”: “noida”,
“preferred_country”: “”,
“preferred_location_zip_code”: “”,
“preferred_organisation”: “”,
“preferred_state_location”: “”,
“preffered_work_mode”: “”,
“primary_skills”: “["java"]”,
"full_name": "lehip80363",
"gender": "",
"git_account_link": "",
"govt_ID": "",
"govt_ID_Link": "",
"hackathon_date_list": "",
"hackathon_technology": "",
"hackathon_with": "",
"highest_qualification": "",
"hobbies": "",
"industry": "",
"instagram_profile_link": "",
"institute_list": "",
"is_actively_searching": 0,
"is_serving_up_notice_period": 0,
"language": "",
"last_working_day": "1969-12-30",
"level_of_certification": "",
"linkedin_profile_link": "",
"location_of_hackathon": "",
"marital_status": "",
"name_of_hackathon_participated": "",
"notice_period": 0,
"other_skills": "",
"past_employer_list": "",
"patent": "",
"pg_college": "",
"pg_education_type": "",
"pg_qualification": "",
"pg_year_of_completion": 0,
"preferred_city_location": "noida",
"preferred_country": "",
"preferred_location_zip_code": "",
"preferred_organisation": "",
"preferred_state_location": "",
"preffered_work_mode": "",
"primary_skills": "[\"java\"]",
"public_speaking_season": "",
"qualification_list": "",
"record_updatedts": "2023-10-29 18:30:06",
"secondary_skills": "",
"topic_of_PHD_or_research_paper": "",
"u_id": "4dbe1767-9b03-4f7d-a4de-a6429f248766",
"ug_college": "",
"ug_education_type": "",
"ug_qualification": "",
"ug_year_of_completion": 0,
"verified_certificate_list": "",
"volunteering_fields": "",
"volunteering_works": "",
"work_mode": "",
"work_permit": "",
"work_permit_country": "",
"work_to_highlight": "",
"yoe": 0
},
{
"PHD_institute": "",
"_id": "653eacd01d5de13ea382a071",
"any_entrepreneurship_experience": "",
"application_ID": 287,
"applied_job_ID_list": "5179f1f5-5cd1-4345-92e5-562c92eeefbb, 10b9bf87-292c-441a-92ec-ac90906e4e07",
"blog_or_articles": "",
"candidate_age": 0,
"college_clubs": "",
"current_city": "",
"current_country": "",
"current_country_code": "",
"current_employer": "",
"govt_ID": "",
"govt_ID_Link": "",
"hackathon_date_list": "",
"hackathon_technology": "",
"hackathon_with": "",
"highest_qualification": "",
"hobbies": "",
"industry": "",
"instagram_profile_link": "",
"institute_list": "",
"is_actively_searching": 0,
"is_serving_up_notice_period": 0,
"language": "",
"last_working_day": "",
"level_of_certification": "",
"linkedin_profile_link": "",
"location_of_hackathon": "",
"marital_status": "",
"name_of_hackathon_participated": "",
"notice_period": 0,
"other_skills": "",
"past_employer_list": "",
"patent": "",
"pg_college": "",
"pg_education_type": "",
"pg_qualification": "",
"pg_year_of_completion": 0,
"preferred_city_location": "",
"preferred_country": "",
"preferred_location_zip_code": "",
"preferred_organisation": "",
"preferred_state_location": "",
"preffered_work_mode": "",
"primary_skills": "[\"java\"]",
"public_speaking_season": "",
"qualification_list": "",
"record_updatedts": "2023-10-29 18:32:45",
"secondary_skills": "",
"topic_of_PHD_or_research_paper": "",
"u_id": "a80913e0-1d22-47b5-a3c5-dac00dff6334",
"ug_college": "",
"ug_education_type": "",
"ug_qualification": "",
"ug_year_of_completion": 0,
"verified_certificate_list": "",
"volunteering_fields": "",
"volunteering_works": "",
"work_mode": "",
"work_permit": "",
"work_permit_country": "",
"work_to_highlight": "",
"yoe": 0
}, now i need help: on how can i structure query to search data from two column/path/parameters for ex:- all user with primary skill java and yoe 5 years