Middle
What did you do with MongoDB?
sobes.tech AI
Answer from AI
With MongoDB, I mainly worked with it as a NoSQL database for storing and processing unstructured data. I was involved in designing document schemas, optimizing queries, and indexing to improve performance. I also used aggregate functions for complex data retrieval and transformation. For example, creating queries to select users based on certain criteria and updating nested documents.
Example of a MongoDB query:
// Find all users older than 25
db.users.find({ age: { $gt: 25 } })
Or updating a nested field:
// Update email for a user with a specific id
db.users.updateOne({ _id: ObjectId("...id...") }, { $set: { email: "newemail@example.com" } })