Questions tagged [flask-pymongo]

75 questions
0
votes
3 answers

flask_pymongo : PyMongo vs MongoClient : [SSL: CERTIFICATE_VERIFY_FAILED]

I have a huge flask application and I use the PyMongo class from flask_pymongo for MongoDB operations. My issue is in development environment. I have a MONGO_URI in my config.py like this: MONGO_URI =…
Spectrum
  • 340
  • 1
  • 4
  • 18
0
votes
1 answer

pymongo pymongo.errors.ServerSelectionTimeoutError:hour must be in 0..23, Timeout: 30s, Topology Description:

I am very new to mongo db. Trying do simple mongo db extraction operation using find method on localhost only. Mongo is running on all default settings. Using python 3.7 and pymongo version 3.11.3 package. I am not getting what is exactly going…
raviraj
  • 335
  • 4
  • 19
0
votes
1 answer

Python Flask mongoengine/pymongo: Connection refused on port 27018 of mongo

The error is: pymongo.errors.ServerSelectionTimeoutError: localhost:27017: [Errno 111] Connection refused, Timeout: 30s, Topology Description:
0
votes
1 answer

Flask PyMongo find_one() return None even when data exists

I just started using MongoDb and I am stuck when using find_one(). The find() function works perfectly but None type is returned when using find_one(). I am stuck at this point. Below is the code that I am…
0
votes
0 answers

Filter already filtered mongodb collection

I am building a REST Api for an HR service and need to implement filters working with Flask and Pymongo. I have a few filters such as technology, experience, city, framework etc. What I am trying to do is to filter by technology first and if some…
0
votes
1 answer

Need equivalent Pymongo command for for the manual working command in MongoDB prompt using array filters

Need the Pymongo (Python Flask) equivalent command for the manual working command: db.UserInfoCollection.update({ "id" : "6efb83dc365fb6bdb3b78a9a"}, {$set:…
Anand
  • 71
  • 9
0
votes
1 answer

Flask-PyMongo. How to display all entries from python to html?

one entry contains: title, link, time, text. How to display all entries from python to html? I tried a lot of options, but I couldn't find the correct syntax. Last try: App.py: from flask import Flask, render_template, jsonify from flask_pymongo…
MeinJunior
  • 25
  • 5
0
votes
1 answer

'Cursor' object has no attribute - In pymongo

Im trying to make a web app in Flask with Pymongo and a MongoDB Im getting that it cant find the attribute password in my db under users elif request.method == 'POST': login_user = request.form['username'] db_user =…
Matthew Casey
  • 145
  • 1
  • 3
  • 12
0
votes
1 answer

$or with properties of specific element of array in document

{ "deviceId": "A", "users": [ { "id": 1, "status": "ac", "DELETE": true }, { "id": 2, "status": "ac" }, { "id": 3, "status": "ac" }, { "id": 4, "status": "ac" …
Vagif
  • 49
  • 1
  • 6
0
votes
1 answer

Inserting data from csv file to mongodb

Made a route in flask to read data from csv file and insert in mongodb. This is my first time writing python code so i'm trying few things what i want to do in my project. @app.route('/adddata', methods=["GET"]) def add_data(): data = [] with…
0
votes
1 answer

how to make bootstrap 4 cards according to mongodb json response?

so i have this document.(see image below). now i want to show this response in the form of bootstrap 4 cards. in this document i have 6 information's. so i have to make cards for each and every information. which i dont want to do. instead of that i…
vatsalay
  • 469
  • 1
  • 9
  • 21
0
votes
1 answer

how to save array of objects after update in mongodb?

so i have this mongodb document (see below) i am updating my mongodb document, with this donateList and requestList. so here's the case: if a user in my webapplication, donating a book. i want to save that books bookid by updating the document. but…
vatsalay
  • 469
  • 1
  • 9
  • 21
0
votes
1 answer

Flask-login current user disappearing on page refresh/redirect

I have a login route: @bp.route('/login', methods=['GET', 'POST']) def login(): form = LoginForm() if form.validate_on_submit(): guest = Guest(**mongo.db.guests.find_one({'username': form.username.data})) if guest is None or…
KGB33
  • 55
  • 2
  • 8
0
votes
1 answer

AttributeError: 'NoneType' object has no attribute on insert from form

I am trying to add form data to mongodb using flask-pymongo insert. I get the following error, and I cant see what I am doing wrong I've tried following tutorials on youtube but while my code seems similar i still get error "AttributeError:…
dannyhr9
  • 1
  • 2
0
votes
0 answers

Problem authenticating using flask_pymongo

Python Version: 3.6 Flask Version: 1.1.1 Pymongo Version: 3.8.0 Flask-PyMongo version: 2.3.0 I'm receiving an unauthenticated message when I attempt any operation in Flask and it appears flask_pymongo is not authenticating. Error…
clg123
  • 175
  • 4
  • 11