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

460
Views
Firestore: la propiedad del filtro de desigualdad y el primer orden de clasificación deben ser iguales. En su defecto donde condicionan y ordenan en diferentes campos. ¿Es esto esperado?

Tengo una colección de documentos como este:

 { uid: <UNIQUE_USER_ID>, lastLoggedIn: <TIMESTAMP_IN_NUMBER>, ... }

cuando trato de obtener los datos usando:

 Server.db .collection(firebasePaths.funfuse_verified_users) .where('uid', 'not-in', notToIncludeAccounts) .orderBy('lastLoggedIn', 'desc') .startAt(startAt) .limit(limit)

Me sale un error diciendo:

 Error: 3 INVALID_ARGUMENT: inequality filter property and first sort order must be the same: uid and lastLoggedIn

¿Es esta una limitación conocida de Firebase o estoy haciendo algo mal? Quiero consultar a todos los usuarios que no están en una matriz using not-in y luego ordenar esos resultados según la actividad de la marca de tiempo lastLoggedIn .

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Como dice el mensaje de error, para poder usar not-in , primero debe ordenar en el mismo campo:

 Server.db .collection(firebasePaths.funfuse_verified_users) .orderBy('uid') .where('uid', 'not-in', notToIncludeAccounts) .orderBy('lastLoggedIn', 'desc') .startAt(startAt) .limit(limit)

Esto también significa que los resultados se ordenarán primero en uid y solo luego (si hay varios resultados con el mismo valor de uid ) en lastLoggedIn . Si los necesitas en otro pedido, tendrás que recurrirlos en tu código de solicitud.

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