Commit 4b572b63 authored by kranthi.kumar's avatar kranthi.kumar

Delete utility.py

parent 012521cb
import logging
from pymongo import MongoClient
class Mongo_utility:
@staticmethod
def connection():
try:
client = MongoClient('143.110.191.155', 37217)
database = client.kranthi
register_details = database.register_details
return register_details
except Exception:
logging.exception("Exception occurred in connection", exc_info=True)
@staticmethod
def insert(register_details, data):
try:
# we can use insert_many for insertion all records at a time.
register_details.insert(data)
except Exception:
logging.exception("Exception occurred", exc_info=True)
@staticmethod
def finding(register_details, query):
try:
details = register_details.find(query)
return details
except Exception:
logging.exception("Exception occurred", exc_info=True)
raise Exception("Problem in Searching")
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment