Skip to main content

A python package for connecting with database.

Project description

# mongo_operations: MongoDB Operations Simplified

mongo_operations is a Python package designed to simplify common MongoDB operations. It provides an easy-to-use interface for interacting with MongoDB databases and collections. Whether you are inserting records, reading data, updating records, or performing bulk inserts, mongo_operations streamlines the process, making MongoDB operations straightforward.

# Installation

Install the package using pip:

pip install PSKConnect==0.0.2

# Usage

## Create an Instance of mongo_operation

from mayyaDatabase import mongo_crud

Provide your MongoDB client URL and database name mongo_op = mongo_crud.mongo_operation(client_url=’your_mongo_client_url’,database_name=’your_database_name’)

## Create a DataBase

Provide the name for your MongoDB collection database = mongo_op.create_database()

## Create a Collection

Provide the name for your MongoDB collection collection = mongo_op.create_collection(collection_name=’your_collection_name’)

## Insert Records

Insert a single record record = {‘key’: ‘value’} mongo_op.insert_record(record=record, collection_name=’your_collection_name’)

Insert multiple records records = [{‘key1’: ‘value1’}, {‘key2’: ‘value2’}] mongo_op.insert_record(record=records, collection_name=’your_collection_name’)

## Read Records

Read all records from the collection mongo_op.read_record(collection_name=’your_collection_name’)

## Delete Records

Provide a query to match records to be deleted query = {‘key’: ‘value’} mongo_op.delete_record(record=query, collection_name=’your_collection_name’)

## Update Records

Provide a query to match records to be updated and an update document query = {‘key’: ‘value’} update = {‘$set’: {‘new_key’: ‘new_value’}} mongo_op.update_record(query=query, update=update, collection_name=’your_collection_name’)

## Bulk Insert from Data File

Provide the path to your data file (CSV or Excel) data_file_path = ‘path/to/your/datafile.csv’ mongo_op.bulk_insert(datafile=data_file_path, collection_name=’your_collection_name’)

## Contributors

### SAIKIRANPATNANA

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

PSKConnect-0.0.2.tar.gz (3.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

PSKConnect-0.0.2-py3-none-any.whl (3.1 kB view details)

Uploaded Python 3

File details

Details for the file PSKConnect-0.0.2.tar.gz.

File metadata

  • Download URL: PSKConnect-0.0.2.tar.gz
  • Upload date:
  • Size: 3.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.18

File hashes

Hashes for PSKConnect-0.0.2.tar.gz
Algorithm Hash digest
SHA256 57f9b67908c86d5a0cc3875394e4bce39d9acdbfc59f3ddf66da567c0055f6d3
MD5 db07457e0a9c5f8fa2268d4945706216
BLAKE2b-256 0ed46e2f8f5573b8f71666a1cadd242847fb2de23ad73abd9c7fbda664fa21fb

See more details on using hashes here.

File details

Details for the file PSKConnect-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: PSKConnect-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 3.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.18

File hashes

Hashes for PSKConnect-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 818ee36902773936787ac71ef233536eaf9b2ac5a71e956a35d8973dd1c1e853
MD5 a8c615949f3e1dd9be14efd0c9254b80
BLAKE2b-256 0f3c6c396cfed17f2251799d2556fef66cb2e4fb756c4eacb16db88f715fa140

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page