Skip to main content

Depends on environment variables:

  • MONGO_DB (Required)
  • MONGO_HOST (Optional)
  • MONGO_PASSWORD (Optional)
  • MONGO_USER (Default: "root")
  • MONGO_PORT (Optional)

Example:

from datetime import datetime, date

from bson import ObjectId

from mongo import Document, PrimaryKey


class Doc(Document):
    key: int | PrimaryKey
    a1: str  # Required
    a2: int | None
    a3: bool | None
    a4: float | None
    a5: ObjectId | None
    a6: datetime | None
    a7: date | None
    b1: list[str]
    b2: list[int]
    b3: list[bool]
    b4: list[float]
    b5: list[ObjectId]
    b6: list[datetime]
    b7: list[date]
    c1: dict


KEY = 0
A1 = "a1"

d = Doc(key=KEY, a1=A1).save()

assert Doc.get(KEY) == d
assert Doc.find(a1=A1) == d
assert Doc.find_all(a1=A1) == [d]
assert d.str_id == str(KEY)
assert d.to_dict() == {
    "_id": KEY,
    "a1": A1,
    "b1": [],
    "b2": [],
    "b3": [],
    "b4": [],
    "b5": [],
    "b6": [],
    "b7": [],
    "c1": {},
}

Metadata

Release files for ext-mongo 0.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ext-mongo 0.4.0
File Size Uploaded Provenance Actions
ext-mongo-0.4.0.tar.gz 2.6 kB Without provenance Details for ext-mongo-0.4.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for ext-mongo 0.4.0
File Interpreter ABI Platform Actions
ext_mongo-0.4.0-py3-none-any.whl Python 3 none any Details for ext_mongo-0.4.0-py3-none-any.whl

Total release size: 6.1 kB

Release files / ext-mongo-0.4.0.tar.gz

Download URL ext-mongo-0.4.0.tar.gz
Size 2.6 kB
Tags Source
SHA-256 checksum
How to use checksums
25546898671af15c50e7585c7ffc9f4bc0c4946cb556149c34438199b13765df
BLAKE2b-256 checksum
How to use checksums
a7e67c804c5311f10eabd109db62e35f4baf2766dfe4f7307efcc2f218945e2b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via pdm/2.4.9 CPython/3.10.5

Release files / ext_mongo-0.4.0-py3-none-any.whl

Download URL ext_mongo-0.4.0-py3-none-any.whl
Size 3.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0e1cb2c1d2c242f2387bdb3402c13d5b8755002c9a14b8217e756f9578116cb8
BLAKE2b-256 checksum
How to use checksums
6a8839c4f47a90817a4ff55460d0169b9dc9d5c477d9c31f0a00fa10761b125e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via pdm/2.4.9 CPython/3.10.5

Security for ext-mongo 0.4.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page