Menu

Weeks 16 & 17: MongoDB and Building a Tech Opportunity Tracker API
📰
0

Weeks 16 & 17: MongoDB and Building a Tech Opportunity Tracker API

DEV Community·Precious Afolabi·about 1 month ago
#cWM4oj2n
Reading 0:00
15s threshold

MongoDB and Building Real APIs Weeks 16 and 17 covered MongoDB operations and the development of a complete API from scratch. MongoDB CRUD Operations Creating Documents insertOne creates a single document. insertMany creates multiple at once. MongoDB generates a unique _id for each document automatically. Documents are flexible. They can have different fields even in the same collection. No fixed schema unless you enforce one with Mongoose. Reading Documents find returns all matching documents. findOne returns the first match. Query operators filter results. Comparison operators: $gt for greater than, $lt for less than, $gte and $lte for greater-than-or-equal-to and less-than-or-equal-to ranges. $in for matching any value in an array. $ne for not equal. Logical operators: $and and $or combine conditions. Pattern matching with regular expressions. Projection selects which fields to return. Limit and skip enable pagination. Sort the results. Updating Documents updateOne modifies the first matching document.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.

Read More