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

329
Views
Indexing on MongoDB UUID field

I have a table in MongoDB having UUID field named artwork_id, and i need to create index on that field, which type of index will be better?

db.artwork_images.createIndex( { artwork_id: "text" } )

OR

db.artwork_images.createIndex( { artwork_id: 1 } )

[Image of UUID field here][1] [1]: https://i.stack.imgur.com/XvHsN.png

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Text indexes are meant to match words inside a field without having to access to the document. In this case you have an UUID field, so you are going to match the whole string every time.

Regular indexes are useful for matching the entire value of a field. If you only want to match on a specific word in a field with a lot of text, then use a text index.

I recommend to have a look to this post Performance best practices indexing

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