
Security News
Open Source Maintainers Feeling the Weight of the EU’s Cyber Resilience Act
The EU Cyber Resilience Act is prompting compliance requests that open source maintainers may not be obligated or equipped to handle.
A Python module to interact with a MongoDB database via HTTP requests.
You can install this module directly from the GitHub repository:
pip install git+https://github.com/yourusername/mongodb_client.git
First, import the MongoDB
class from the module and initialize it with the base URL of your MongoDB HTTP server:
from mongodb_client.mongodb import MongoDB
client = MongoDB(base_url="http://localhost:8080")
Sign in with your email and password to receive an access token:
success = client.signin("email@example.com", "password")
if success:
print("Signed in successfully!")
else:
print("Failed to sign in.")
Retrieve records from a specific database and collection:
records = client.get_records("mydatabase", "mycollection")
print(records)
Retrieve a specific record by its ID:
record = client.get_record_by_id("mydatabase", "mycollection", "record_id")
print(record)
Create new records in a specific database and collection:
new_record = {"name": "John Doe", "email": "john@example.com"}
response = client.create_records("mydatabase", "mycollection", new_record)
print(response)
Update an existing record by its ID:
updated_data = {"name": "Jane Doe"}
response = client.update_record("mydatabase", "mycollection", "record_id", updated_data)
print(response)
Delete a specific record by its ID:
response = client.delete_record("mydatabase", "mycollection", "record_id")
print(response)
Delete all records in a specific database and collection:
response = client.delete_records("mydatabase", "mycollection")
print(response)
Contributions are welcome! Please open an issue or submit a pull request for any improvements or bug fixes.
This project is licensed under the MIT License. See the LICENSE file for details.
FAQs
A Python module to interact with a MongoDB database via HTTP requests.
We found that mongodb-client demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
The EU Cyber Resilience Act is prompting compliance requests that open source maintainers may not be obligated or equipped to handle.
Security News
Crates.io adds Trusted Publishing support, enabling secure GitHub Actions-based crate releases without long-lived API tokens.
Research
/Security News
Undocumented protestware found in 28 npm packages disrupts UI for Russian-language users visiting Russian and Belarusian domains.