🔷
Pyot Documentation
  • Pyot Documentation
  • Cores
    • Installation
    • Configuration
    • Objects
    • Concurrency
    • Resources
    • Exceptions
    • Warnings
  • Examples
    • Single File
    • Multi Root
    • Module Based
  • Pipeline
    • Expirations
    • Handler
    • Object
    • Token
  • Stores
    • CDragon
    • DDragon
    • DiskCache
    • DjangoCache
    • MerakiCDN
    • MongoDB
    • Omnistone
    • RedisCache
    • RiotAPI
  • Limiters
    • MemoryLimiter
    • RedisLimiter
  • Models
    • League of Legends
      • Champion
      • Championmastery
      • Championrotation
      • Clash
      • Item
      • League
      • Match
      • Merakichampion
      • Merakiitem
      • Profileicon
      • Rune
      • Spectator
      • Spell
      • Status
      • Summoner
      • Thirdpartycode
      • Tournament
    • Legends of Runeterra
      • Card
      • Match
      • Ranked
      • Status
    • Riot Services
      • Account
    • Teamfight Tactics
      • Champion
      • Item
      • League
      • Match
      • Profileicon
      • Summoner
      • Thirdpartycode
      • Trait
    • Valorant
      • Content
      • Match
      • Ranked
      • Status
  • Utils
    • LoL
      • Cdragon
      • Champion
      • Routing
    • LoR
      • Cards
    • Tft
      • Cdragon
      • Routing
    • Aiohttp
    • Copy
    • Functools
    • Importlib
    • Itertools
    • Logging
    • Nullsafe
    • Safejson
    • Sync
    • Text
    • Threading
  • Integrations
    • Django
    • FastAPI
    • Celery
  • Changelog
    • 5.x.x
    • 6.x.x
Powered by GitBook
On this page
  1. Stores

MongoDB

PreviousMerakiCDNNextOmnistone

Last updated 2 years ago

  • Type: Cache

  • Description: Uses Mongo NoSQL DBs as Caches.

This store is best for production environment due to its high speed, TTL indexes and mainly disk based storage. Built on top of Python Async Driver of MongoDB .

DB level sharding is possible by following the Mongo's docs for sharding and pass the necessary kwargs to the settings.

An extra installation is required: pip install pyot[mongodb]

class MongoDB

Backend: pyot.stores.mongodb.MongoDB

Definitions:

  • __init__

    • db: str

      Name of the database to be used.

    • host: str = '127.0.0.1'

      Host of the Mongo DB instance.

    • port: int = 27017

      Port of the Mongo DB instance.

    • expirations: Dict[str, int | float | timedelta] = None

    • log_level: int = 0

    • **kwargs

      Any extra kwargs provided will passed into motor.motor_asyncio.AsyncIOMotorClient. e.g. authentication params.

Motor