Questions tagged [djongo]

For usage with the djongo backend driver for MongoDB with the Django framework

Djongo allows you to use MongoDB as the database back end with the Django framework.

The project can be found on GitHub:

https://github.com/nesdis/djongo

274 questions
0
votes
1 answer

I need query to return all document that contains a specific string in list

I need to perform a django query to return all document that contains a specific string "amazon" in the list, and this list is stored in a dict. The field is a dict and each key in the dictionary contain a list type. This sample of my document: { …
Alyahya
  • 105
  • 2
  • 13
0
votes
0 answers

Django Rest Framework and MongoDB - listField does not works It returns None when object is embedded

I'm using MongoDB the connection is provided by Djongo, over is being used DRF to manage all request to mi API. My data (profile) is structured like this { "name" : "profile name", "description" : "this is a description", "params" : "X1,…
jhuazano
  • 31
  • 4
0
votes
0 answers

How to get MongoDB connection object in Django?

I am using djongo as default engine. I want to get the MongoDB connection object just like we get mysql object from from django.db import connection How can we do that in Django so that i can perform raw queries of MongoDB? I know we can do this…
Deepak Chauhan
  • 782
  • 7
  • 10
0
votes
0 answers

Django - MigrationError after I add a new field into existing model and mongoDb

I have a MigrationError when a django view executes the get function of a model object user_profile = UserProfile.objects.get(user=request.user) the exeption as below : HTTP GET /media/website/bg_chat.PNG 200 [0.22, 127.0.0.1:1417] Internal Server…
D. Ahmed
  • 345
  • 1
  • 3
  • 18
0
votes
3 answers

Unable to pass model to context

I'm trying to pass a single model, and a list of models with the same "document_title" to my ModelDetailView template. The code for the views.py section is class DocumentDetailView(generic.DetailView): model = Document def…
0
votes
1 answer

Count records according to the difference of two dates in Mongodb

Based on the documents below, I need to count the records that the difference between the inicial_date and end_date is greater than and less than 5 minutes and the name = A. [{ "_id": 1, "name": "A", "inicial_date": "2019-01-01…
0
votes
0 answers

int() argument must be a string, a bytes-like object or a number, not 'set'

I am not able to set up an ArrayReferenceField in Django using Djongo as the Engine. I am trying to build a Database which stores Projects of a student with the skills related to build that Project using ArrayReferenceField. The Form is generated…
0
votes
1 answer

how to handle exception in django multiple database

error screenshot try: DATABASES = { 'default': { 'ENGINE': 'djongo', 'NAME': 'jobstar', } } except: DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', …
soubhagya
  • 788
  • 2
  • 12
  • 37
0
votes
1 answer

How to display in Django Templates Embedded Models?

models.py class Decomposicao(models.Model): tirosina = models.BooleanField('tirosina') fenilalanina = models.BooleanField('fenilalanina') class Meta: abstract = True class SDF(models.Model): numero =…
0
votes
2 answers

How to reference a nested model als foreign key in djongo

I'm experimenting with Djongo right now: Is there a possibility to reference the djongo nested models in another model as a foreign key? Or how would you deal with this structure in djongo? Clinic 1:n Wards - Ward 1:n Cases (The cases should still…
Gurkenkönig
  • 678
  • 15
  • 36
0
votes
2 answers

How to solve this error `ValueError: Value must be a list` in Django

I have following code to update some records: Product.objects.filter(id=4).update(feature={'top_selling':False}) When I try above code, got next error: ValueError: Value must be a list
0
votes
0 answers

Djongo return empty QuerySet when exasing next page

This only happens when I made a model to have 2 inheritance from the same model: class Word(models.Model): cuvint = models.ForeignKey(KeyWordsMapping, on_delete=models.CASCADE, related_name="%(class)s_cuvint") frequency =…
ottomd
  • 429
  • 6
  • 16
0
votes
1 answer

convert_datetimefield_value() takes 4 positional arguments but 5 were given using django with mongodb

Django Admin login page, I am using mongodb for django, after that only I got error mongodb configure: DATABASES = { 'default': { 'ENGINE': 'djongo', 'NAME': 'django-mongo-db', } } Click Here
0
votes
1 answer

Mongodb with django using djongo?

If I use mongodb in django project with the help of djongo third-party api should I have to use commands migrate and makemigrations again n again when ever I make changes in my models??
0
votes
1 answer

Convert into json

FAILED SQL: INSERT INTO \"brand\" (\"brand_id\", \"name\", \"notification_email\", \"notification_phone\", \"created_at\", \"updated_at\") VALUES (%(0)s, %(1)s, %(2)s, %(3)s, %(4)s, %(5)s)\nPymongo error: {\'index\': 0, \'code\': 11000,…
1 2 3
18
19