Base de datos en tiempo real Get by Field

// Firebase v9
// Don't forget to add index in Firebase->Realtime Database->Rules
// Should looks like this:
// {
//   "rules": {
//     "path": {
//       ".indexOn": ["fieldName"]
//     }
//   }
// }
get(
    query(
      ref(database, 'path'),
      orderByChild('fieldName'),
      equalTo('yourValue')
    )
  );
Simon