Questions tagged [django-mongodb-engine]

Django MongoDB Engine is a MongoDB database backend for Django.

Django MongoDB Engine is a database backend adding support for MongoDB to the Django web framework.

85 questions
0
votes
0 answers

How to access mongo db data in django project?

I have two db in my django project. Default db mysql and secondary db mongodb. DATABASES = { 'default': { 'ENGINE': 'django.db.backends.mysql', 'NAME': 'xyz', 'USER': 'root', 'PASSWORD':'1234', 'HOST':'127.0.0.1', …
0
votes
1 answer

Serialize DynamicField

I have some model: class Settings(mongoengine.Document): name = mongoengine.StringField() range = mongoengine.DynamicField() And serializer for it: class SettingsSerializer(serializers.DocumentSerializer): class Meta: model =…
Mike
  • 860
  • 14
  • 24
0
votes
1 answer

How to write python-django queires and import them?

Data : { "Fruit": "Pomegranate", "District": "Nasik", "Taluka": "Nasik", "Revenue circle": "Nasik", "Sum Insured": 28000, "Area": 1200, "Farmer": 183 } { "Fruit": "Pomegranate", "District": "Jalna", "Taluka": "Jalna", …
0
votes
2 answers

I want to writing a queires in python script which is ultimately going to call these queries from django

Here is my mongodb database : **{"Fruit" : "Pomegranate", "District" : "Nasik", "Taluka" : "Nasik", "Revenue circle" : "Nasik", "Sum Insured" : 28000, "Area" : 1200, "Farmer" : 183 } {"Fruit" : "Pomegranate", "District" : "Jalna", "Taluka" :…
0
votes
1 answer

Access a value from a list field in django

I have a list field in my django model for users as follows: name = models.CharField() email = models.CharField() profiles = ListField() I am using mongo as storage database with help of django_mongodb_engine. For one user, model object…
Dania
  • 1,007
  • 1
  • 14
  • 21
0
votes
0 answers

Django: int() argument must be a string or a number, not 'ObjectId'

When testing my connection to MongoDB I put the following in my models.py. I had to change some parts of it (JSONField) because I'm using newer version of Django 1.8.7 which seems to have made it not work: from django.db import models from jsonfield…
Peter G.
  • 7,816
  • 20
  • 80
  • 154
0
votes
1 answer

How to apply "sort" on embedded document in django mongodb engine

I am using django-mongodb-engine. I have example data as below: { "name":[{"first_name":"rajat","last_name":"verma"},{"first_name":"jay","last_name":"patil"},] } Now I want to apply sorting on first_name field. I tried to search on google and…
jatinkumar patel
  • 2,920
  • 21
  • 28
0
votes
1 answer

What versions of Django does the Django MongoDB Engine support?

Is the maintenance and support for Django MongoDB Engine still active? I searched online and found that the original author of Django MongoDB Engine already quit the project. I am wondering if it supports Django 1.8. If not, I would switch to…
Chonghao
  • 98
  • 1
  • 10
0
votes
1 answer

Entry in mongolab sandbox database happens without save() in django

What i have with me is a setup of Django with Mongo engine. I have used mongolab sandbox addons from heroku. While running locally with mongolab settings provided via heroku, what i observe that if i create an instance of my model, it gets saved to…
chaitanya90
  • 697
  • 2
  • 8
  • 24
0
votes
1 answer

Index mongodb data in solr via haystack

Recently, I changed some of my DB data from postgres to mongo in order to get better performance and because of the flexibility of mongodb (my DB is already big, and now I have to support 5 more languages over the same models) I am using solr with…
0
votes
1 answer

Perform tests on Django using multiple DBs (MySQL and MongoDB)

I am trying to run tests on the app I am developing and I am having problems. The application uses 2 databases, an MySQL one for configuration and relational data and a MongoDB one for some other records that are not relational. It works when I'm…
Fabiot
  • 429
  • 1
  • 4
  • 13
0
votes
1 answer

Mongo + Postgres + Django Testing Error - Multiple Databases (Django-MongoDB-Engine)

I have been trying to get my django testing working for an API I am building. I am newer to Python and have been stuck on this for a little while. Some quick facts: I am using 2 databases - A postgresql database for my users and a mongo database…
0
votes
1 answer

What functionality is lost when using django with mongodb?

I am evaluating whether I want to use mongoDB with django for my next project. What I am not sure about, though, is what functionality (ORM, admin, forms, etc.) I loose when I use a DB backend that is not officially supported. I consider using the…
Private
  • 2,626
  • 1
  • 22
  • 39
0
votes
1 answer

Regex in MongoDB raw_query

How will I apply regex on mongo db's raw_query? I tried {'foo.bar': {$regex:'.*test.*'}} but django shell complained for an invalid syntax. I also tried {'foo.bar': '.*test.*'} assuming that the regex will take effect. But the result is…
jaysonpryde
  • 2,733
  • 11
  • 44
  • 61
0
votes
1 answer

EmbeddedModelField in custom user model

I'm using django-mongodb-engine to make a site. I have a custom user model that looks like this: class User(AbstractUser): trigrama = models.CharField(max_length=3, unique=True) external_email = models.EmailField(unique=True) …
Ionut Hulub
  • 6,180
  • 5
  • 26
  • 55