TheDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/tutosrive/fastapi-CRUD-MongoDB/llms.txt
Use this file to discover all available pages before exploring further.
GET /tasks/{id} endpoint looks up a single task document in MongoDB using the provided ObjectId string. The controller calls find_one({'_id': ObjectId(id)}), converts the raw BSON document to a clean Python dict via task_entity(), and returns it as a JSON response. If no document matches the given id, the server raises an HTTPException with status 404 and the detail message "Task Not Found!".
GET /tasks/{id}
Path Parameters
MongoDB ObjectId expressed as a 24-character hex string (e.g.
64a1b2c3d4e5f6789abcde01). This value is the id field returned when a task is created.Response Fields
MongoDB ObjectId serialised as a 24-character hex string.
The short title of the task.
A detailed description of what the task involves.
Whether the task has been completed. Defaults to
false.Identifier for the user who created the task.
Example Request
Example Response
Error Responses
| Status | Detail | Cause |
|---|---|---|
404 Not Found | "Task Not Found!" | No task document exists in MongoDB with the provided id. |
500 Internal Server Error | Server error message | Database connection failure or malformed ObjectId string. |