Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

237
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!