Skip to main content

MongoDB driver for pynosqlc

Project description

pynosqlc-mongodb

MongoDB driver for pynosqlc — connects to MongoDB via pymongo's AsyncMongoClient.

Install

pip install alt-python-pynosqlc-mongodb

Requirements

  • Python 3.12+
  • MongoDB 4.4+
  • pymongo 4.6+

Usage

import asyncio
from pynosqlc.core import DriverManager, Filter
import pynosqlc.mongodb  # auto-registers MongoDriver

async def main():
    async with await DriverManager.get_client(
        'pynosqlc:mongodb://localhost:27017/mydb'
    ) as client:
        col = client.get_collection('orders')
        await col.store('o1', {'item': 'widget', 'qty': 5})
        f = Filter.where('qty').gt(0).build()
        async for doc in await col.find(f):
            print(doc)

asyncio.run(main())

URL scheme

pynosqlc:mongodb://<host>:<port>/<dbname>

Example: pynosqlc:mongodb://localhost:27017/mydb

The pynosqlc: prefix is stripped before passing the URL to pymongo — the remainder is a standard MongoDB connection string, so replica set URIs and authentication options (e.g. mongodb://user:pass@host/db) work as-is.

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

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

alt_python_pynosqlc_mongodb-1.0.3-py3-none-any.whl (6.1 kB view details)

Uploaded Python 3

File details

Details for the file alt_python_pynosqlc_mongodb-1.0.3-py3-none-any.whl.

File metadata

  • Download URL: alt_python_pynosqlc_mongodb-1.0.3-py3-none-any.whl
  • Upload date:
  • Size: 6.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.2 {"installer":{"name":"uv","version":"0.11.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for alt_python_pynosqlc_mongodb-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 5e089ab6fdfccde965cbcb4cfe12be4a2907889d615f8aaf1e7c5c6378294f97
MD5 084ebbae2159fb2cd8bd293b17c4a30b
BLAKE2b-256 a70aee17f0d0819d623910cb82f936a6eb15e9e9270ada3225cd3735330bda14

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