im doing a simple Flask-MongoDB CRUD application but i keep getting the error message AttributeError: 'Cursor' object has no attribute 'title' for my show route.
db = mongo.db
products_collection = db.products
@app.route("/product/<product_title>")
def product(product_title):
product = products_collection.find({"title": product_title})
return render_template('product.html', title=product.title, product=product)
Where in my DB the products have a title field.
I belive that the problem is in the "product.title" where it isn't acessing the title through the product variable