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

148
Vistas
How to correctly set the sort mode of a query with Bodybuilder?

I've picked up a project that uses Bodybuilder.js for queries to ELK and I am struggling to figure out how to format the query with Bodybuilder. I should note that I've tested this same query in other languages and it worked fine.

As I had written it previously it was:

"sort" {
    "duration": {
        "order": "desc",
        "mode": "max"
    }
}

As far as I can tell from the docs (end of the last example) it should be written something like:

.sort([{ "duration": { "order": "desc", "mode": "max" }}])

but this query is giving me an error from the server. I should note that:

.sort("duration", "desc")

on the other hand does not give an error, but does not give the desired result, just to clear up any concern about the key itself.

Information on this is a bit sparse but hopefully someone who's ran into this before can offer some help as the docs aren't giving me more than I mentioned and that's not working.

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