i'm asking a question. When working with mongoDB, can we return a django response with a document(get with find_one()) and work with or do i have to parse the document to build json and return it ?
Asked
Active
Viewed 159 times
1
-
Could you please use mongo engine, please refer http://mongoengine.org/ – Shreeyansh Jain Jun 04 '13 at 09:02
-
The question is too vague to answer. MongoDB is a database, and although it works in a different way to SQL databases the principles of using it in an application are pretty much the same. What, exactly, are you having trouble with? – Daniel Roseman Jun 04 '13 at 09:06
1 Answers
1
You have several options here. If you want to have an abstraction layer (ORM), you should consider using:
- mongoengine (docs on django support)
- django-mongodb-engine
- other packages
Alternatively, if you want be "closer to metal", you can just use pymongo (python mongodb driver) directly. But, I bet you will quickly find yourself reinventing wheels.
Also see similar questions:
- https://stackoverflow.com/questions/1972480/has-anybody-actually-used-django-mongodb
- Django-nonrel vs Django-mongodb vs Mongokit vs pymongo native
Hope that helps.
-
thanks for the help, but can i combine 2 ORM. I currently use Mysql to stock several datas but i need to Mongo to store huge amount of datas. ex: mysql store datas related to a thermometer like name, position, etc. all datas collected are stored in mongo – billyJoe Jun 04 '13 at 11:39
-
I don't have that experience, but, I'm pretty sure you can. Don't hesistate to ask any specific question in a separate thread if you'll have any problems with it. – alecxe Jun 04 '13 at 13:01