Questions tagged [mongoengine]

MongoEngine is a Document-Object Mapper (think ORM, but for document databases) for working with MongoDB from Python. It uses a simple declarative API, similar to the Django ORM.

MongoEngine is a Document-Object Mapper (think ORM, but for document databases) for working with MongoDB from Python. It uses a simple declarative API, similar to the Django ORM.

1823 questions
0
votes
2 answers

creating object of a class that has keyword arguments at runtime in python

I am using mongoengine in python as an ORM. Now I have a situation where I have a class, actually the a model, of the form: from mongoengine import * class SomeDetails(Document): alias = StringField(required=True) version =…
qre0ct
  • 5,680
  • 10
  • 50
  • 86
0
votes
0 answers

How to make object id validation error silent while fetching data mongoengine

I am trying to query the mongodb database using the mongoengine in django Here's the code: Document: class User(Document): name = StringField(max_length=60, required=True) meta = { 'collection': 'users' } and when I try to…
Rohit Khatri
  • 1,980
  • 3
  • 25
  • 45
0
votes
1 answer

Slow queries in mongoengine

I'm using Mongoengine to perform query against MongoDB database and then save result as json file. My document definition looks like this: class Foo(Document): # fields definitions goes here @queryset_manager def some_fields(self,…
mateuszb
  • 1,083
  • 10
  • 20
0
votes
1 answer

How to transfer MySQL database to MongoDB using MongoEngine?

I have an existing collection in MongoDB and I need to update certain documents by getting values from a MySQL table. Currently, I am using the following python code to update the Collection using MongoEngine but it takes a lot of time since the…
Grimlock
  • 1,033
  • 1
  • 9
  • 23
0
votes
0 answers

mongoengine.connection.ConnectionError with django

I am trying to build a django rest framework application with mongodb backnd , for which I am using mongoengine. According to issues #935 of mongoengine (closed already in github) say, had to go down to the version of mongoengine and that of pymongo…
Lily
  • 46
  • 4
0
votes
2 answers

Django query set filtering, how to filter data on dynamic list

I am using django 1.10 and mongodb in backend. For mongodb I am using mongoengine 0.11. In mongodb, I have collection named "test_coll", which contains fields "name","dept" and "tag". Sample data from collection is as follow- name dept …
sachin27
  • 145
  • 3
  • 13
0
votes
1 answer

How to query over a list of embedded documents with allow_inheritance

If I have the following schema: class Post(EmbeddedDocument): title = StringField(max_length=120, required=True) meta = {'allow_inheritance': True} class TextPost(Post): content = StringField() class MoviePost(Post): author =…
spitz
  • 658
  • 1
  • 8
  • 19
0
votes
2 answers

Delete embedded document using mongoengine and flask

I want to delete a embedded document with a specific '_id' using flask and Mongoengine. Document have this structure: class Main(db.Document): title = db.StringField(max_length=156, required = True) press =…
Mauro
  • 79
  • 6
0
votes
1 answer

is db_column changing my mongodb field?

i'm new here. I'm having a problem with django where i have 'type' which is a reserved keyword as a column in mongodb. Based on answers in stackoverflow, I solved it by applying…
0
votes
1 answer

Token based Authentication using django + mongoengine

I'm using mongoengine + django. I need to use Token-based Authentication. I googled a lot but found with django.contrib.auth. Somewhere I found mongoengine.django.auth but it doesn't work for me. Here is the link where I found. May be, I get…
iNikkz
  • 3,729
  • 5
  • 29
  • 59
0
votes
1 answer

Cannot connect to mongodb usign mongoengine with read(only) access

I have working CLI tool created with mongoengine running on linux environment MongoDB = 3.4.1 Python = 2.7.5 PyMongo = 3.4.0 MongoEngine = 0.11.0 I am connecting to database with information in .ini file that looks like…
Kyras
  • 63
  • 1
  • 5
0
votes
2 answers

Embeded serializers in DRF for mongo and django

I am trying to create a non model embeded serializer in Django Rest Framework. I'm stuck here. Need you help. Thanks in advance. class IPNetwork(serializers.ListSerializer): network_netmask = serializers.IPAddressField(required=False) …
0
votes
1 answer

Django - Mongoengine Group By + Where + Sort + Limit and print the results

I make a query to my database and select the collection reviews. I want to filter, to organize, to group, to sort and to limit my results from the query. The query is in views.py. It works fine but i have a problem to print the content of context…
0
votes
4 answers

Why do I getting 'FileField' object has no attribute 'put'?

Following http://mongoengine.org/docs/v0.4/guide/gridfs.html documentation about mongoengine FileField I did the following: In my model files = ListField(FileField()) In my test code # Create an entry photo = FileField() f =…
coulix
  • 3,328
  • 6
  • 55
  • 81
0
votes
1 answer

Mongoengine pre_delete FileField

I'm new to mongoengine. I am trying to get the pre_delete hook to delete a FileField storing in GridFS. I am using Python 2.7.10, Mongo 3.4 and mongoengine 0.8.7. Here is what I have. import uuid import mongoengine as me class…
Daniel
  • 542
  • 1
  • 4
  • 19
1 2 3
99
100