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

239
Vistas
How to see if Realm ObjectId equals String (JavaScript)

I'm using MongoDB's Realm and trying to see if an ObjectId is equal to a string with the same characters. I've tried casting the ObjectId to a string and vice versa, but No matter what I try, it doesn't see them as equal even though the values are the EXACT same and they look the same when I log them. Please help lol

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

ObjectId's can directly be used in comparisons with other ObjectId's - meaning there are <, >, <=, =>.

Also, the string representation of an ObjectId can be retrieved as

ObjectId.toString()

which returns the JavaScript representation in the form of a string literal "ObjectId(...)".

Given this

ObjectId("507f191e810c19729de860ea").str

would evaluate to

507f191e810c19729de860ea
about 4 years ago · Juan Pablo Isaza 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