Skip to content
Advertisement

Tag: mongoengine

Does mongo db ListField maintain ordering?

If I add items to a ListField on a mongo db document in a specific order and then write it to the database, is it guaranteed that all subsequent reads will see the list in the same order? e.g. write read this is using python mongoengine ORM v0.4.2 Answer Yes they do, the driver is faithful to the underlying data

Python Mongo docker-compose Topology Error

I’m trying really simple example of mongo with python and got an error. Dockerfile: run_test.sh docker-compose.yaml: db_test.py: db.py: I’m doing docker-compose up and got this output: So it looks like it can’t connect to the database. I didn’t change ports or something, and another example works like a charm with those settings, so I don’t really know what I’m missing.

Query by computed property in python mongoengine

I wondered if it is possible to query documents in MongoDB by computed properties using mongoengine in python. Currently, my model looks like this: When I do for example SnapshotIndicatorKeyValue .objects().first().snapshot, I can access the snapshotproperty. But when I try to query it, it doesn’t work. For example: I get the error `mongoengine.errors.InvalidQueryError: Cannot resolve field “snapshot”“ Is there any

Mongoengine: Exception has occurred: ServerSelectionTimeoutError

I am having some issues connecting to my database on MongoDB. I am using mongoengine library to connect to the DB. I am also using ATLAS. Whenever I try to run my project it keeps showing “Exception has occurred: ServerSelectionTimeoutError” then show [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate If anyone could assist me? Or any

MongoEngine: Close connection

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. Answer I know this is an old question, but if anyone else is searching I figured I’d give an alternate answer. close() does not actually remove the connection from MongoEngine’s connection list.

Advertisement