Registry / database / mongo-ninja-python

mongo-ninja-python

JSON →
library1.11.1.7pypypiunverified

A Python client for MongoDB that provides a simplified query builder and ORM-like interface. Current version 1.11.1.7, actively maintained with frequent updates.

pip install mongo-ninja-python
INSTALL
IMPORT
SIG · MONGO-NINJA-PYTHON
M
mongo-ninja-python
databasepythonv1.11.1.7
Install
6.5s avg
Import
Disk
75MB
Pass rate
5/ 10
Env Coverage5 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.11.1.7 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
build_error
glibc
py 3.103.95 runs
installs and imports cleanly · install 6.5s · import 0.000s · 73MB
75MB installed
● package 75MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

NinjaClient
from ninja import NinjaClient
from mongo_ninja import NinjaClient

Connect to a local MongoDB instance and insert a document into the users collection.

from mongo_ninja import NinjaClient client = NinjaClient(uri='mongodb://localhost:27017', db='test') collection = client.collection('users') result = collection.insert_one({'name': 'Alice', 'age': 30}) print(result.inserted_id)
Debug
Known issues
breakingIn v1.11.0, the 'db' parameter was renamed to 'database' in NinjaClient constructor. Old code passing 'db=...' will raise TypeError.
fix
Use `database='...'` instead of `db='...'`.
affects: >=1.11.0
deprecatedThe `find_one()` method with positional arguments is deprecated. Use keyword arguments for query filters.
fix
Replace `collection.find_one({'name': 'Alice'})` with `collection.find_one(filter={'name': 'Alice'})`.
affects: >=1.10.0
gotchaAutomatic connection pooling may cause stale connections after network interruptions. Configure `maxPoolSize` and `serverSelectionTimeoutMS` explicitly in production.
fix
Pass `options={'maxPoolSize': 10, 'serverSelectionTimeoutMS': 5000}` to NinjaClient.
affects: all
Upgrade
Version history
1.11.1.7latest on PyPI · released Dec 13, 2023
Audit
Dependencies
pymongorequiredCore MongoDB driver dependency
Agent activity
6 hits · last 30 days
node
6
Resources
mongo-ninja-python — pip install mongo-ninja-python · libregistry