mongoengine Questions

2

I am developing a simple Telegram chat bot using python-telegram-bot library. My bot is currently using the ConversationHandler to keep track of the state of the conversation. I want to make the c...
Nondisjunction asked 21/3, 2020 at 1:19

2

I'd like to check whether my script connected to mongoDB successfully. I am using Python and mongoengine. How can I do that? It looks like the connect() method is not actually connecting to the dat...
Ching asked 28/4, 2020 at 20:45

2

Solved

I'm modelling a MongoDB database in MongoEngine for a web project. I want to store the data in a slightly unusual way to be able to efficiently query it later. Our data in MongoDB looks something ...
Antrum asked 18/11, 2014 at 10:21

3

Solved

I have thousands of documents in this format: { "_id" : ObjectId("51e98d196b01c2085c72d731"), "messages" : [ { "_id" : ObjectId("520167056b01c20bb9eee987"), "id" : ObjectId("520167056b01c20bb9e...
Tenedos asked 23/8, 2013 at 18:5

3

Solved

I'm trying out MongoEngine for a project and its quite good. I was wondering if it is possible to set a default value for a field from another field? Something like this import mongoengine as me ...
Archduchy asked 4/6, 2014 at 18:56

4

I am working to try and build a login method for a while now. I am running a Flask app and have it working well. It all runs locally on my machine. Currently, I am using pymongo and MongoClient to ...
Highmuckamuck asked 4/3, 2019 at 22:16

4

Solved

In my new Django project I set up a MongoDB database and use mongoengine module but I can't properly access the dabase neither in shell nor in views. "ConnectionError: You have not defined a d...
Dry asked 17/2, 2014 at 0:8

2

I am using Celery and MongoEngine as part of my Django App with. I am getting this warning, when a celery @shared_task accesses the mongodb database via mongoengine model classes: UserWarning: Mo...
Outflank asked 23/5, 2017 at 11:24

3

Solved

I am playing around with FastAPI a bit and wanted to connect it to a MongoDB database. I however am confused which ODM to choose between motor which is async and mongoengine. Also, in the NoSQL exa...

6

Solved

I have the following MongoEngine document { '_id': 'some_id', 'data': 'some_data' } How can I delete this document using MongoEngine? What I've tried: import my_collection obj = my_collecti...
Grout asked 26/5, 2016 at 16:19

5

Solved

I'm working with mongoengine in Django, this is my document defination: class Location(mongoengine.Document): user_id = mongoengine.IntField(required=True) point = mongoengine.GeoPointField(r...
Collen asked 9/12, 2011 at 15:10

3

I am building a website using Django and MongoDB. There are 2 popular API framework that we can use to connect Django and MongoDB, one is mongoengine and the other is django-mongodb-engine. Becau...
Cauldron asked 22/7, 2015 at 2:34

7

Solved

Is it possible to update a MongoEngine document using a python dict? For example: class Pets(EmbeddedDocument): name = StringField() class Person(Document): name = StringField() address = Str...
Prop asked 25/9, 2013 at 10:30

1

I am having trouble creating a customizable swagger schema in the Django Rest Framework. I have read pages of documentation, but have not found a clear cut example on how to generate swagger annota...
Metaplasia asked 13/3, 2017 at 19:36

2

Solved

I have a collection that has an EmbeddedDocumentField. I'm having trouble finding examples of how to delete an embedded document from the collection. Can someone provide me with an example or refer...
Hoxie asked 7/3, 2014 at 2:26

3

Solved

i have a question about pagination using mongodb and mongoengine. i have a table which will have millions of records in future. and i am doing paging like this. well i am not sure this is correct ...
Indestructible asked 22/11, 2012 at 5:11

4

Solved

I need get documents from db by oid, like: Docs.objects(_id='4f4381f4e779897a2c000009') But how to do it, if _id requires ObjectId object and even I try to set ObjectId from pymongo it doesn't w...
Ezarra asked 3/4, 2012 at 6:45

2

Solved

I have a small Flask app which uses MongoEngine. my project structure: /myproject -application.py -config.py /my_app -models.py -views.py my application.py: #!/usr/bin/env python from fla...
Prominent asked 25/4, 2013 at 4:29

4

Solved

I am not sure how to connect to a mongodb database that uses an authentication database with mongoengine. On the command prompt I need to do mongo hostname:27017/myApp -u "test" -p "test" --authen...
Sealey asked 6/11, 2016 at 1:6

7

Solved

I'm using the bottle framework together with mongoengine. I have an orders model : class OrderDetail(Option): orderDetailsQty = FloatField() def to_dict(self): return mongo_to_dict_helper(self...
Quintus asked 5/11, 2012 at 10:35

5

Solved

I am trying to query my database. Some records currently have extra fields that are not included in my model schema (by error, but I want to handle these cases). When I try to query the DB and tran...
Personify asked 7/4, 2015 at 15:14

1

First of I'm new to python and flask. I've searched around and tried something things to no avail. I have a model that has a DateTimeField as one of the members, let's call it "created_at". When I ...
Furgeson asked 10/10, 2014 at 20:18

4

Solved

I spent ages trying to find a simple example where MongoEngine was being used and a connection was being closed. Finally figured it out and posting my code.
Menendez asked 9/5, 2017 at 9:28

4

Solved

There are many ways to select random document from a mongodb collection (as discussed in this answer). Comments point out that with mongodb version >= 3.2 then using $sample in the aggregation fram...
Colis asked 7/6, 2016 at 12:54

2

Solved

Is there an equivalent function in PyMongo or mongoengine to MongoDB's mongodump? I can't seem to find anything in the docs. Use case: I need to periodically backup a remote mongo database. The l...
Blitzkrieg asked 7/7, 2014 at 12:19

© 2022 - 2024 — McMap. All rights reserved.