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

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

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 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