Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

realtime database 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')
    )
  );
 
PREVIOUS NEXT
Tagged: #realtime #database #field
ADD COMMENT
Topic
Name
8+5 =