Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

292
Vistas
React JS - How to Create a Dynamic URL Instead of Id Which is in Mongoose Schema

How can I make the dynamic URL which is present in the Database as the link (tag) how can I use that link for fetching only one post from that database like an e-commerce website (it makes the new page for each post)

http://localhost:3000/{here is the link}

here is my code =>

Schema of Mongoose (link)

const mongoose = require('mongoose');

const Posts = mongoose.model('Posts', {
    link: {
        type: String,
        required: true,
        unique:true
    },
    
    title: {
        type: String,
        required: true
    }
    
    });

module.exports = { Posts }

"addPosts": {
    "link": "newoneawesomed",
    "title": "How can we achieve sucessfully",}

Below I making for id that renders a separate post from MongoDB

like

http://localhost:3000/625d056d4e412fb823d9cc4e

But how can achieve instead of id?

is

http://localhost:3000/newoneawesomed

which is present in the database...

Pls... help me to Solve these problems

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda