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

242
Vistas
How to find middle of the string, next to space and dot in MongoDB
 [
    {
        "Name": "Dr.Soma",
        "Email": "drsoma@gmail.com",
        "MobNo": 111111111
    }, 
   {
        "Name": "Bootha Ganesh",
        "Email": "boothaganesg@gmail.com",
        "MobNo": 222222222
    }, 
   {
        "Name": "Steven",
        "Email": "steven@gmail.com",
        "MobNo": 333333333
    },
    {
            "Name": "Dr.Anbarasi",
            "Email": "anbarasi@gmail.com",
            "MobNo": 4444444444
     }
     ]

I try this to using find regex

db.details.find({Name:{$regex:/steven/i}})

output:

   {
      "Name": "Steven",
      "Email": "steven@gmail.com",
      "MobNo": 333333333
    }

How to find data Name dot(.) after Soma & Space after Ganesh
Excepted Output
If I find Name Ganesh,I need

{
            "Name": "Bootha Ganesh",
            "Email": "boothaganesg@gmail.com",
            "MobNo": 222222222
  }

If I find Name small s or capital S ,I need

{
        "Name": "Dr.Soma",
        "Email": "drsoma@gmail.com",
        "MobNo": 111111111
 }

No Need Name Dr.Anbarasi data

over 4 years ago · Santiago Trujillo
2 Respuestas
Responde la pregunta

0

db.collection.find({ Name: { $regex: "Soma" } })

mongoplayground


db.collection.find({ Name: { $regex: ".Soma" } })

mongoplayground


db.collection.find({ Name: { $regex: " Ganesh" } })

mongoplayground

over 4 years ago · Santiago Trujillo Denunciar

0

db.collection.find({"Name": {'$regex': /\bsoma[a-zA-Z0-9]*/gi}})

\b assert position at a word boundary: (^\w | \w$ | \W\w|\w\W)
soma-for searching value
[a-zA-Z0-9]-word characters
*-to entire string

over 4 years ago · Santiago Trujillo Denunciar
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