Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

241
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda