Node.js
Fondamental
Connecting to a MongoDB database with Mongoose

Type d'évaluation

Mise en situation réelle

Analyse

Intelligence Artificielle

Compétences ciblées

nodejs
mongoose
mongodb
schema
database

Scénario Technique

Context A Node.js API needs to persist user data to a MongoDB database using a schema-based approach. The Problem The team is using raw MongoDB driver queries with no schema validation, leading to inconsistent document structures in the database. Constraints Define a Mongoose schema and model for a User (name, email, createdAt). Connect to MongoDB using the connection string from an environment variable. Implement a save and find operation using the model. Expected Deliverable A Node.js module using Mongoose to define a User schema, establish a database connection from an environment variable, and perform basic CRUD operations.

Prêt à évaluer ce talent ?

Accédez à l'interface de test complète pour soumettre votre architecture ou votre code.

Commencer le Défis
    Node.js - Connecting to a MongoDB database with Mongoose | Défi Technique & Recrutement — CodeDuel