Today I gained my API and Microservices certificate!
Frameworks and tools I used
- MongoDB Atlas
- Mongoose
- Express
- multer
- body parser
Patterns I learnt
- The callback patterns of Express
- Scheme - Model - Query of mongoose
Challenges I met
- Manually implement auto-increment in MongoDB
- Validating a JavaScript
Dateobject. Ifnew Date()is passed with an invalid argument, the output is anInvalid Dateobject which is also an instance ofDate. The invalid date could be identified throughisNaN(invalidDate). - Chaining queries. The user could choose whether they want to add a
fromandtofilter into their query, as well as alimitfield. See here for what I did for the GET router'/api/exercise/log?[userId]&{from}&{to}&{limit}'. - Handling file uploads with Express multer middleware