All Questions
47 questions
5
votes
1
answer
369
views
MongoDB cache decorator
I think I cooked again, but maybe not. I'll share with you the product of today's cooking:
...
4
votes
2
answers
265
views
Connecting MongoDB using Motor in FastAPI
What are the best practices for connecting to a database in FastAPI?
To provide some context, I want to write code to connect to a MongoDB database using Motor. My idea is to create a single ...
1
vote
0
answers
113
views
Whatsapp Bot using Mongodb
I have this Whatsapp bot made using Twilio and persistent with mongodb due to the nature of the logic I am following the code is become more of a cluttered and seems un-pythonic. It works fine as I ...
1
vote
1
answer
123
views
Archiving MongoDB data to S3, with retryable steps
I have a python script to archive some data (export from mongo to a local json file and then upload it to s3)
Is there a better way to implement/improve the current flow? Each step should be be ...
1
vote
0
answers
146
views
Python/Mongo - Generating dummy data
I wrote below piece of code generating dummy data loaded to MongoDB.
2 issues :
1.customer class has subscriber class so it nested with one level customer--> subsciber.
I think i'm not doing right:
...
2
votes
0
answers
753
views
mongodb RESTfull api in python using fastapi and mongoengine
So I wrote a a RESTfull api for a mongodb with python3.7, fastapi and mongoengine and id love to get feedback on how I should make my code more readable, clean, and dry.
basically there are 4 main ...
2
votes
0
answers
269
views
Simple Flask REST API to a MongoDB
I'm writing a simple REST API to my MongoDB using PyMongo (Python 3.7).
Each collection I have in the DB has a route (e.g http://the.api.url/collection_name ),
and every document under that collection ...
3
votes
1
answer
218
views
Python REST API and Mongo - Aggregation Pipeline/Stage classes
This has been my approach for "simplifying" MongoDB aggregation queries in a pythonic syntax - was my intent, at the very least:
...
4
votes
2
answers
255
views
MongoDB connection manager
I wrote a class for some MongoDB operations. So far I'm self-taught and mostly I follow the style from already existing code at my workplace (a startup).
We don't have a code-review culture, so I'm ...
2
votes
0
answers
88
views
Return aggregated values
It's the first time a write a non-trivial mongodb query, and I came up with one that does work, but is 123 lines long! Surely there must be a way to write it in a more concise way.
The purpose of the ...
3
votes
2
answers
116
views
Simple automation executing platform in Python
I'm building a platform like Rundeck/AWX but for server reliability testing.
People could log into a web interface upload scripts, run them on servers and get statistics on them ( failure / success).
...
2
votes
1
answer
1k
views
Import huge XML data set into MongoDB while parsing data
I am currently working with the Stack Exchange Data Dump - to be more precise - with the dumped Posts.xml data set from Stack Overflow.
What am I trying to achieve?...
3
votes
1
answer
91
views
Speed up Python Script to populate MongoDB
How would I go about making this script much faster? Essentially it reads from a file and the slowest part is populating the words. In the words file there are over 100k words and I was looking for a ...
2
votes
0
answers
45
views
Representing LXC component configuration in django
I want to represent components of LXC in django; so I defined them in models: Container, Network, Profile and Devices where each one of them have a set of attributs, but when it comes to representing ...
3
votes
0
answers
780
views
MongoQ - A Task queue system using Mongo
I've been using Beanstaldk (not Amazon's one) for years and loved the possibility to handle delays and priorities in the tasks, but I recently had to filters the tasks for specific reasons, and ...