Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

169
Views
How does fastapi+pymongo+jinja2 delete mongodb data

/I model/

from pymongo import MongoClient
from pydantic import BaseModel
from fastapi import FastAPI,Request
from typing import List
from fastapi.templating import Jinja2Templates  from fastapi.staticfiles import StaticFiles
app = FastAPI()                                                                                 templates = Jinja2Templates('/root/py/templates')
app.mount('/static', StaticFiles(directory='/root/py/static'), name='static')
def get_top():                                      
  DB = "slack"                          
  MSG_COLLECTION = "messages"            
  url="mongodb://localhost:27017/"                                               
  client_link=MongoClient(url)[DB][MSG_COLLECTION]                              
  return client_link                                                                                                                                          

class Message(BaseModel):                                                                 
  channel: str                                    
  author: str                                     
  text: str

@app.get("/") 
async def home(request: Request):
      doc=mydoc.find().distinct('channel')+mydo                    

c.find().distinct('text')+mydoc.find().distinct('author')                    
      ​data_all={"request":request,                             "doc":doc,                          }
      ​return templates.TemplateResponse("index.html",data_all)

/Looking for a js solution, do not nodejs , I don't understand nodejs code, thank you, ask for a solution. For example, I want to delete 'channel': 'jo', how to write fastapi and js respectively?/

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!