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

153
Visualizações
nodejs control a bidirectional playback of geo-coded json data from mongodb or file

I have a js frontend, to a backend WAMP router, that has a nodejs app that publishes JSON encoded geo-coded data in real time to a WAMP topic. The frontend subscribes to that WAMP topic and visualizes the moving geo-coded targets on a map. That data is also stored on the backend within MongoDB.

I need to add a function whereby the user can request, play, stop, rewind, and fast-forward through archived data. I have a backend nodejs function that receives the begin/end times for the query from the frontend, makes the MongoDB query and uses the MongoDB db.find.stream() interface to publish the data to a WAMP topic in realtime. The stream.on("data", ...) method pauses/resumes the stream to playback the data in time-step. This works fine for playback and stop. But, I don't know how to handle rewind and fast-forward. Based on what I've seen, you can't rewind or iterate backwards on a stream.

My brute force approach would be to load the entire huge query result into an in memory array and have methods the frontend calls to control the increment/decrement of the array pointer depending on if they are playing or rewinding so that they can see the targets moving on the map and find what they are looking for.

Is there an API or library that would allow me to accomplish rewind without loading the array into memory? Possibly storing the result into a file and moving back and forth through it?

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