Changes between Version 24 and Version 25 of NoSqlSupport

12/07/2017 10:14:23 PM (3 years ago)



  • NoSqlSupport

    v24 v25  
     10= Django + Mongodb = Djongo =
     12[ Djongo] is specifically meant for connecting the **original** Django ORM (instead of a non-rel flavor) to MongoDB. Using the Django `admin` app one can add and modify documents in MongoDB. Other `contrib` modules such as `auth` and `sessions` also work without any changes.
     14 Usage:: Connecting Django to MongoDB is similar to any other DB (like Postgresql or OracleDB)
     17        1. `pip install djongo`
     18        2. Into file of your project, add:
     20        {{{
     21        #!python
     23        DATABASES = {
     24                'default': {
     25                        'ENGINE': 'djongo',
     26                        'NAME': 'your-db-name',
     27                }
     28        }
     33        3. Run ` makemigrations` followed by ` migrate`
     36 Working:: Djongo is a SQL to MongoDB query compiler. It translates a SQL query string into a MongoDB query document. As a result, all Django features, models, etc., work as is. For more information checkout [ Djongo documentation] and a discussion on [ Integrating Django with MongoDB]
     38 = Django-nonrel =
    1040The [ Django-nonrel] branch of Django already provides support for NoSQL and it requires only minimal changes to Django's ORM. However, for the more interesting features like `select_related()` Django's ORM needs to be refactored and simplified in several areas. Many of the sections in this page are described from the point of view of Django-nonrel since a lot of experience required for official NoSQL support has been integrated in the Django-nonrel project.
    2151Also take a look at the [ feature comparison matrix] for an overview of what is supported and what is missing. Database-specific features are sometimes provided by an automatically added manager. For example, MongoDB adds a manager which adds map-reduce and other MongoDB-specific features.
    23 [ Djongo]: Efforts to connect the original Django ORM (instead of a non-rel flavor) to MongoDB are also being made. Currently all Django contrib modules (Eg: Auth, Session, etc,.) work fine with MongoDB. In addition, the Django Admin module works fine with MongoDB as well. Embedded documents or Array of embedded documents can be written into MongoDB using the Django Admin webapp.
    2553= Representing result rows =
Back to Top