import pymongo

# Create a MongoDB client
client = pymongo.MongoClient("mongodb+srv://poorna:poorna@cluster0.u0uqpgf.mongodb.net/?retryWrites=true&w=majority")

# Access the desired database and collection
database = client["MachinesDB"]
collection = database["cloud_ceat"]

# # Create a document to insert
# document = {
#         "backupPolicyList" : ['poorna','santhosh','praveen'],
#         "cloudName" : "chambal"
#     }


document = {
        "fFolderSize" : "8.0K",
        "memcachedUptime" : "9h",
        "outgoingUtilized" : "1",
        "BlukryptStatus" : "0",
        "MongoCapValue" : "Not Set",
        "MemoryPartTompcb" : "1024",
        "IncomingThread" : "0",
        "MongoLastBackup" : "-",
        "Available" : "5959",
        "mongodUptime" : "1 weeks 0 days",
        "MongoDb" : "4.1G",
        "IncomingUtilized" : "0",
        "HostName" : "samstage",
        "tomcatpcb1Uptime" : "9h",
        "Apache2Uptime" : "9h",
        "parabluSize" : "2.0T",
        "MaxConnectionsPerChild" : "0.0",
        "parabluDiskAvailable" : "1.4T",
        "Swap Memory / Disabled" : "38911",
        "lastNightlyRestart" : "Thu Jul 20 02:04:59 IST 2023",
        "Mongo Version" : "v4.0.9",
        "Usable Space" : "002.7 GB",
        "MaxClients" : "0.0",
        "Free Physical Memory" : "2605",
        "MachineVersion" : "2.5.4.15",
        "lastMongoUpdate" : "N/A",
        "ServerLimit" : "0.0",
        "SyncFolderSize" : "8.0K",
        "tmpFolder" : "252K",
        "System Name" : "poornakasssshi.site",
        "parabluDiskMounted" : "Mounted",
        "tomcatjob11Uptime" : "14s",
        "ServerType" : "0.0",
        "MongoBackupFolder" : "1.9G",
        "Processor" : "4 Cores",
        "Used Physical Memory" : "9705",
        "Free Space" : "002.8 GB",
        "MaxRequestWorkers" : "150.0",
        "cronUptime" : "1 weeks 0 days",
        "uploadFileSizeLimitInMB" : "1",
        "Total Space" : "028.9 GB",
        "WireTigerSize" : "4096 bytes",
        "Date & Time " : "2023/07/20 11:26:32",
        "UploadFolder" : "77G",
        "parabluUsed" : "522G",
        "Total Physical Memory" : "16009",
        "OutgoingThread" : "20",
        "BackupPolicy" : "enabled",
        "Grep429" : "0",
        "maxSpareServer" : "10.0",
        "SystemUptime" : "42 days",
        "minSpareServer" : "5.0",
        "/parablu" : "NotWritable",
        "Shared Memory" : "5",
        "MemoryPartTomjob" : "1024",
        "Buff/Cache" : "3697",
        "patchFileSize" : "16G",
        "StartServer" : "5.0",
        "CloudName" : "ceat"
}


# Insert the document into the collection
collection.insert_one(document)

# value = collection.find_one({"cloudName":"chambal"})

# collection.delete_many({'CloudName': {'$ne': 'ceat'}})



# backupValue = value.get("backupPolicyList")
# 
# print(backupValue)



print("Document inserted successfully.")
