mongoengine icon indicating copy to clipboard operation
mongoengine copied to clipboard

A Python Object-Document-Mapper for working with MongoDB

Results 169 mongoengine issues
Sort by recently updated
recently updated
newest added

Hi! I have the following models: ```python class A(Document): name = StringField() class Embedded(EmbeddedDocument): ref = ReferenceField('A', reverse_delete_rule=DENY) class B(Document): children = MapField(EmbeddedDocumentField('Embedded')) ``` But I obtain the error: ```...

Hi, Is it possible to export a MongoEngine Document as a mongo-friendly [JSON schema](https://docs.mongodb.com/manual/reference/operator/query/jsonSchema/)? It might be quite helpful for writing migrations and ensuring that the collection has exactly the...

I am migrating from MongoEngine 0.8.\* to .10.* I have this code: ``` python obj, created = Model.objects.get_or_create(...) if created: obj.a_field = ... ``` I am trying to replace the...

- Models: ``` import datetime import uuid from mongoengine import * class Model1(Document): id = UUIDField(primary_key=True, default=uuid.uuid4, binary=False) attr1 = StringField(required=True) attr2 = IntField() attr3 = BooleanField() creation_date = DateTimeField(default=datetime.datetime.utcnow)...

Calling `disconnect` or `disconnect_all` in a multi-threaded environment is unsafe. Consider the following code: ```py import threading import time from mongoengine import * connect(host="mongodb://127.0.0.1:9800/test_db_1") class User(Document): email = StringField(required=True) first_name...

I am currently on `0.20.0` for `mongoengine`. I have a route `/healthcheck` which does something like `Foo.object.count()` to make sure mongo connection is valid. When I try upgrading `mongoengine` to...

Since .count was deprecated, MongoEngine was switched to the Collection.count_documents method exclusively. This caused major issue for people for simple cases where estimated_documents_count could be used. This PR adds a...

i will try to describe my usecase here: i am using a `multi tenant` db model in which each client has their own database( due to very specific business use...

Awaiting Response
Client/Connect

Hello, this is more of a question that an issue. I've been checking my HTTP requests and found that this database call (model.objects()) called **create_index** 4 times. The collection **PlaceWithScoreModel**...

Hi, I am looking at the docs about `Document.save` here https://docs.mongoengine.org/apireference.html#mongoengine.Document.save It states that if a doc does not exists it will be created. However, given that `force_insert` is by...