Showing posts with the label mongodb

[FIXED] Mongoengine: ConnectionError: You have not defined a default connection

Issue In my new Django project I set up a MongoDB database and use mongoengine module but I can'…

[FIXED] How to query mongoengine by using contains in list?

Issue If I have a collection with a list field similar to the below. class Post(Document): tags…

[FIXED] Updating an embedded document in mongoengine

Issue I have a class in mongoengine class Post(EmbeddedDocument): uid = StringField(requir…

[FIXED] Querying a list in mongoengine; contains vs in

Issue I have a ListField in a model with ids (ReferenceField), and I need to do a query if a certai…

[FIXED] Classical mapping in MongoEngine

Issue I'm new to MongoEngine and it looks like we need to create sub classes of the class Docum…

[FIXED] Does mongo db ListField maintain ordering?

Issue If I add items to a ListField on a mongo db document in a specific order and then write it to…

[FIXED] pre_save not working in mongoengine update_one

Issue I am using Python mongoengine and I would like to define callback, which will be called every…

[FIXED] MongoEngine delete document

Issue I have the following MongoEngine document { '_id': 'some_id', '…

[FIXED] Iterating Mongoengine queryset - how to prevent big memory consumption

Issue In my deployment environment I am trying to run a script with a loop similar to the one below…

[FIXED] Autoincrement with MongoEngine

Issue I'm developing a blog engine with Flask and MongoEngine, and I need sequential IDs for my…

[FIXED] How can I transpose a list of documents in MongoDB?

Issue I have a document like: { "_id": "6345e01473144cec0073ea95", "…

[FIXED] How can I find if any user with given ID exists on an array of arrays using flask and mongoengine?

Issue I have a collection with multiple Course documents. On it, i have an array of course_users li…

[FIXED] TypeError: Object of type function is not JSON serializable when using flask_jwt_extended int RESTful API

Issue I'm building a REST API using flask. I'm using postman for testing a route that creat…

[FIXED] Flask API Routes not catching exceptions

Issue May be a little confused on how flask handles errors. Working on adding error handling to a D…

[FIXED] Flask-restful How to `marshal_with()` data in reference_field of mongoengine?

Issue I use Flask-restful and MongoEngine ,I want to show the data in ReferenceField of my model …

[FIXED] Query nested documents inside an object in mongodb

Issue I have developed a Python-Flask app using Mongoengine and mongodb as my database. I want to …

[FIXED] what is correct way to define Many2Many, Many2One in mongoengine

Issue I am creating a data model for my new project where I have to use Many2Many, Many2One, One2Ma…

[FIXED] MongoEngine: storing EmbeddedDocument in DictField

Issue I'm modelling a MongoDB database in MongoEngine for a web project. I want to store the d…

[FIXED] MongoEngine: Operator "__contains" does not work with non-english letters or words

Issue When trying to use Q(nickname__contains="") from mongoengine.queryset.visitor, mong…

[FIXED] How do I update if exist and insert if not using mongoengine (python)

Issue It is really absurd how mongoengine has such arcane documentation. I am trying to do a simple…