Index Firebase data

0

I need help with a firebase rule to index some data.

The problem is the following:

I need to filter the products that correspond to a certain category:

If you filter by "Category 4" you should show me product 1 and product 3

Any help is appreciated: D

This is my data structure:

{
  "products" : {
    "-LN60j-wUW0aH-7PNI1C" : {
      "productCategory" : [ "Categoria 1", "Categoria 4", "Categoria 5" ],
      "productDescription" : "Descripción",
      "productImage" : "producto1.jpg",
      "productName" : "Producto 1",
      "productPrice" : "2000",
      "productStock" : "27"
    },
    "-LN64im-3dtwAc-9KHKX" : {
      "productCategory" : [ "Categoria 2", "Categoria 5" ],
      "productDescription" : "Descripción",
      "productImage" : "producto2.jpg",
      "productName" : "Producto 2",
      ...
    },
    "-LN64ubBJzgOrDFOIXtO" : {
      "productCategory" : [ "Categoria 3", "Categoria 4", "Categoria 5" ],
      "productDescription" : "Descripción",
      "productImage" : "producto3.jpg",
      "productName" : "Producto 3"
      ...
    },
    "-LN652GUdk1zgCPwKYXS" : {
      ...
    },
    "-LN65CMPEV_mAkMnFXSJ" : {
      ...
    },
    "-LN65L3NLEDC5HvyoS4D" : {
        ...
    }
  }
}
    
asked by Raúl Mario Pozo Henríquez 24.09.2018 в 16:10
source

0 answers