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

143
Visualizações
taking a bills that has not been paid from last month MongoDB

so I want to take a bills that's not been paid since last month and take a bills for this month so I have this query to check that

const pastBills = await Customer.find({
    id_customer: (
      await Meteran.find({
        $and: [
          {
            id_usage: {
              $nin: (await Bills.find()).map((bill) => bill.id_usage),
            },
          },
        ],
      })
    ).map((meter) => meter.id_customer).length === 2,
  });

I want to check which customer_id is the same with the customer_id in meteran that have two different id_usage that's not in the bills. but even thought I have two different id_usage that's not in the bills it returned an empty array can anyone help me to solve this?

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