MongoDB is the primary data store for the UZSE Backtest App. It holds both the raw trade records scraped from the Uzbekistan Stock Exchange and the computed OHLCV candlestick data derived from them. All pipeline stages — from importing trades to building candles and running gap checks — read from and write to this database. The connection is configured via a singleDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/theonetrade/uzse-backtest-app/llms.txt
Use this file to discover all available pages before exploring further.
MONGO_URI environment variable, making it straightforward to point the app at a local container or a remote Atlas cluster.
Docker Compose
The project ships a ready-madedocker-compose.yaml under docker/mongo/ that runs MongoDB Community Server 8.0.4 on the default port 27017. Data is persisted to a local mongo_data/ directory via a bind mount so it survives container restarts.
Starting MongoDB
Connection
Set theMONGO_URI environment variable to point the application at your MongoDB instance. The default value targets the local Docker container:
| Setting | Value |
|---|---|
| Host | localhost |
| Port | 27017 |
| Database | backtest |
backtest is embedded in the URI. You can target a different database by changing the path segment. See Configuration for details on setting environment variables.
Collections
Mongoose creates both collections automatically on the first document insert — no manual setup is required. The two collections used by the app are:trade-results
Raw UZSE trade records scraped from the exchange. Each document represents a single executed trade, including price, quantity, volume, issuer, and a SHA-1 hash for idempotent imports.
candle-items
Computed OHLCV candlestick data built from the raw trades. Each document stores open, high, low, close, volume, symbol, interval, and timestamp fields.
Importing Pre-Built Data Dumps
If you have existing JSON exports of the database (for example, from a colleague’s environment or a public snapshot), you can load them directly withmongoimport:
Eight years of UZSE trade history generates a substantial number of documents across both collections. Make sure the
mongo_data volume is backed by a persistent, adequately-sized disk — especially in cloud or VM environments where ephemeral storage is the default. Running out of disk space mid-import will corrupt the volume and require a full re-import.Related Pages
Configuration
Set MONGO_URI and other environment variables.
Import Trades
Load scraped trade JSON files into MongoDB.
Build Candles
Aggregate trade records into OHLCV candlesticks.
Trade Schema
Full field reference for the trade-results collection.