A pure Python-implemented database that looks and works like MongoDB
montydb
Monty, Mongo tinified. MongoDB implemented in Python!
What is it?
A pure Python-implemented database that looks and works like MongoDB.
>>> from montydb import MontyClient
>>> col = MontyClient(":memory:").db.test
>>> col.insert_many( [{"stock": "A", "qty": 6}, {"stock": "A", "qty": 2}] )
>>> cur = col.find( {"stock": "A", "qty": {"$gt": 4}} )
>>> next(cur)
{'_id': ObjectId('5ad34e537e8dd45d9c61a456'), 'stock': 'A', 'qty': 6}
Most of the CRUD operators have been implemented. You can visit issue #14 to see the full list.
This project is tested against:
- MongoDB: 3.6, 4.0, 4.2 (4.4 on the way💦)
- Python: 2.7, 3.6, 3.7, 3.8, 3.9
Install
pip install montydb
-
optional, to use real
bson
in operation (pymongo
will be installed)
For minimum requirements,montydb
ships with it’s own