mongoengine Questions

4

Solved

I'm building and API on top of Flask using marshmallow and mongoengine. When I make a call and an ID is supposed to be serialized I receive the following error: TypeError: ObjectId('54c11732205304...
Vintner asked 22/1, 2015 at 16:28

3

Solved

I have a class in mongoengine class Post(EmbeddedDocument): uid = StringField(required=True) text = StringField(required=True) value = StringField() class Feed(Document): label = StringField(r...
Homoiousian asked 5/1, 2013 at 9:35

5

Solved

I am trying to start a new thread in Python inside of a Flask application. I am doing background work that gets triggered by the request, but I don't need to wait for the work to be done to respond...
Liquidize asked 29/3, 2012 at 19:2

3

There is an existing collection in mongo called students. Is there a way where I don't have to type out the schema for all the fields and directly import all the fields from the collection? class S...
Fingerboard asked 19/7, 2020 at 11:15

2

i'm looking for a way to take my json schema and dynamically create a mongoengine class at runtime. for example: the mongoengine class written below class user(Document): _id = StringField(requ...
Gastrectomy asked 25/11, 2015 at 15:14

6

in Mongoengine 0.7.10, I can still do things like: class User(db.Document): email = db.EmailField(unique=True, required=True) _password = db.StringField(max_length=255, required=True) @propert...
Antisthenes asked 2/6, 2013 at 9:49

1

I am very new to django world and I try to do some example to use it with mongodb. To connect to mongo I am using mongoengine 0.9.0. I am also using virtualenv. At the moment I have pretty basic s...
Unlikelihood asked 17/4, 2016 at 17:58

9

Solved

I am trying to add a creation_time attribute to my documents. The following would be an example: import datetime class MyModel(mongoengine.Document): creation_date = mongo.DateTimeField() modif...
Louannlouanna asked 11/11, 2011 at 18:7

3

Solved

I have a flask application for which I used mongoengine to create the database. But now, I need to connect with MongoDB Atlas' Cluster, but I only could find how to do it with Pymongo: client = pym...
Bondmaid asked 13/9, 2019 at 23:26

2

I am having trouble saving documents to a new collection and then deleting them from the old one. I create a new object like so: class Test(mongo.Document): field = mongo.StringField() t = Test...
Gushy asked 15/7, 2015 at 5:33

1

I need to log all the queries generated by MongoEngine in my Django app. I cannot use cursor._query() as I need to log queries for all the MongoEngine Documents. The logging should be done at app...
Umbel asked 14/11, 2016 at 6:52

3

Solved

how do I check if an ListField() attribute of a Mongo Class is not set or empty? Thanks!
Aurify asked 8/8, 2012 at 15:27

1

Solved

MongoDB and PyMongo both supports bulk write or inserting multiple documents at once. MongoDB: db.collection_name.insertMany() PyMongo: collection.insert([list_of_objects]) But I couldn't fin...
Interrogative asked 4/10, 2019 at 7:29

2

Solved

I'm using MongoEngine in a web-scraping project. I would like to keep track of all the images I've encountered on all the scraped webpages. To do so, I store the image src URL and the number of ti...
Cowherd asked 31/1, 2013 at 10:21

1

Solved

I am running a website application and am using Flask which queries a mongodb database using mongoengine. Am getting an error when the application tries to query the database. I have mongodb insta...
Thach asked 6/9, 2019 at 4:19

1

I am creating my a document having a field as EmbeddedDocument using mongoengine. But I am getting the following error : AttributeError: 'EmbeddedDocument' object has no attribute '_is_document...
Tletski asked 5/9, 2018 at 11:29

3

Solved

Can anyone please explain why I am getting error Another user is already authenticated to this database. You must logout first when connecting to MongoDB using Flask MongoEngine? from mongoengine....
Faison asked 7/7, 2018 at 5:54

1

In official documentation of mongoengine, it says that as of 0.8, no_cache() is added into the mongoengine. What's the benefit it can bring to us? What's the typical scenario no_cache apply for?
Mystery asked 3/12, 2018 at 6:27

5

Solved

I'm using python's mongoengine to query MongoDB, and have loved it for the most part, but I'm having an issue with an advanced query. Here's my model class ContentItem(Document): account = Referen...
Ofris asked 18/11, 2011 at 22:0

1

Solved

Once content is added the name of the collection is defaulted to the name of the class. Is it possible to specify the collection name or is my approach wrong? Using the code I have my collection is...
Earleanearleen asked 30/12, 2018 at 10:43

2

Solved

I did the following -- `sudo apt-get install mongodb-org` -- go to `etc/mongod.conf` change bindIp to: `0.0.0.0` -- sudo mkdir /data/db -- start without auth to create user `sudo mongod --port 27...
Schoolbag asked 14/3, 2016 at 11:3

2

Solved

In django how to get latest instance of a query set if i'm using MongoEngine Normally we do Users.objects.latest('id') But i cant use latest in MongoEngine. ;) . i'm in stuck . I didn't find ...
Fango asked 20/3, 2014 at 11:11

2

Solved

I have these mongoengine models declared: class SyncDiscrepancy(EmbeddedDocument): upi = StringField(primary_key=True) error_code = IntField(required=True) meta = { 'indexes': ['upi', 'error_...
Laser asked 8/1, 2015 at 17:44

2

Solved

I have an existing mongo document which has been exposed over a REST API. The API request will contain certain fields from the document which either needs to be updated with new values or insert ne...
Highboy asked 10/7, 2018 at 6:25

2

Solved

I'm working with Flask/Mongoengine-MongoDB for my latest web application. I'm familiar with Pymongo, but I'm new to object-document mappers like Mongoengine. I have a database and collection set ...
Countermove asked 23/8, 2014 at 22:35

© 2022 - 2025 — McMap. All rights reserved.