skip to Main Content

Query to search specific nested list of JSON data in mongoDB using python

I have Docs in mongo DB in the following format - Here outerTimestamp is in string format and Price is int format { "_id":"ObjectId(""622f950e73043487031bb3ee"")", "outerTimeStamp" : "14-Mar-2022", "filtered":{ "data":[ { "Price":14350, "expiryDate":"17-Mar-2022", "info1":{ "Price":14350, "expiryDate":"17-Mar-2022", }, "info2":{ "Price":14350, "expiryDate":"17-Mar-2022" }…

VIEW QUESTION

Why I can't connect my telegram bot to Mongodb Atlas using Python? – Telegram API

This is my code from telegram.ext import Updater, CommandHandler import os from pymongo import MongoClient TOKEN = 'TOKEN' def get_db(update, context): cluster = MongoClient("mongodb+srv://testing:[email protected]/test?retryWrites=true&w=majority") result = list(cluster.get_database('DBNAME')['COLLECTIONNAME'].find({})) update.message.reply_text(str(result)) def main(): updater = Updater(TOKEN, use_context=True) dp = updater.dispatcher dp.add_handler(CommandHandler("getdb", get_db)) updater.start_webhook(listen="#.#.#.#",…

VIEW QUESTION
Back To Top
Search