How prudhvichamp0911/mongodb works
This is a contact-database demo with a web API for natural-language, read-only contact queries, backed by MongoDB. The main workflow is a question submitted through the web interface, routed by the server to an agent, translated into a MongoDB query, executed, and summarized for the caller. A separate import workflow normalizes CSV contacts and loads them into MongoDB. README capabilities include CRUD, filtering, sorting, aggregation, and indexes; the sampled runtime implements read queries and aggregation, while the importer performs data replacement and indexing. The UI implementation was not sampled, so its API connection is unverified.
Main entry points: agent.js Query agent · server.js HTTP server · index.html Web interface · db.js Database access
Components 9
Web interface
- Web interface
mongodb/mongodb-api-project/public/index.html - HTTP server
mongodb/mongodb-api-project/server.js
Query service
- Query agent
mongodb/mongodb-api-project/agent.js - OpenRouter LLM
Contact storage
- Database access
mongodb/mongodb-api-project/db.js - MongoDB Atlas
Data import
- Contacts CSV
mongodb/mongodb-api-project/data/contacts.csv - CSV importer
mongodb/mongodb-api-project/scripts/import.js
Other components
- User
Connections 10
- User → Web interface: asks question
- Web interface → HTTP server: submits query
- HTTP server → Web interface: serves static files
mongodb/mongodb-api-project/server.js - HTTP server → Query agent: routes question
mongodb/mongodb-api-project/server.js - Query agent → OpenRouter LLM: generates query
mongodb/mongodb-api-project/agent.js - Query agent → Database access: gets collection
mongodb/mongodb-api-project/agent.js - Database access → MongoDB Atlas: connects to
mongodb/mongodb-api-project/db.js - Query agent → OpenRouter LLM: summarizes results
mongodb/mongodb-api-project/agent.js - CSV importer → Contacts CSV: reads records
mongodb/mongodb-api-project/scripts/import.js - CSV importer → Database access: connects and loads
mongodb/mongodb-api-project/scripts/import.js