0
 [ {
"categories" : [ {
"id" : 0
 }, {
  "id" : 1
  } ],
    "height" : "134",
   "image" : 2,
    "is_active" : "1",
   "layer_count" : "3",
   "name" : "1",
    "symbol_keywords" : [ {
  "keyword_id" : 10
  }, null, null, {
  "keyword_id" : 13
   }, {
  "keyword_id" : 14
  }, {
  "keyword_id" : 15
   } ],
   "symbol_layers" : [ {
  "cmyk" : "0,0,0,70",
  "height" : "71",
  "hexa" : "706F6F",
  "layer" : "1",
  "rgb" : "112,111,111",
  "symbol_id" : "1",
  "width" : "126",
   "xpos" : "107",
  "ypos" : "59"
   }, {
  "cmyk" : "0,70,20,0",
  "height" : "66",
  "hexa" : "ED6D91",
  "layer" : "2",
  "rgb" : "237,109,145",
  "symbol_id" : "1",
   "width" : "66",
  "xpos" : "158",
  "ypos" : "59"
   }, {
  "cmyk" : "0,80,40,0",
   "height" : "12",
   "hexa" : "EA516D",
  "layer" : "3",
  "rgb" : "234,81,109",
  "symbol_id" : "1",
  "width" : "15",
   "xpos" : "110",
   "ypos" : "78"
   } ],
   "symbol_text" : [ {
   "align" : "center",
   "bold" : "0",
   "cmyk" : "0,80,40,0",
  "color" : "EA516D",
  "font" : "gabrielle",
  "height" : "48",
  "italic" : "0",
  "line" : "CompanyName",
  "rgb" : "234,81,109",
  "size" : "75",
  "text" : "1",
  "underline" : "0",
   "width" : "400",
  "xpos" : "0",
  "ypos" : "160"
   }, {
 "align" : "center",
  "bold" : "0",
  "cmyk" : "0,0,0,70",
   "color" : "706F6F",
    "font" : "quicksand_book",
    "height" : "35",
     "italic" : "0",
    "line" : "YOUR SLOGAN",
    "rgb" : "112,111,111",
    "size" : "20",
    "text" : "2",
      "underline" : "0",
    "width" : "400",
    "xpos" : "0",
    "ypos" : "244"
   } ],
 "variant_of" : "0",
 "weightage" : "75",
 "width" : "239",
 "xpos" : "100",
 "ypos" : "40"
  }, {
 "categories" : [ {
  "2" : {
  "id" : 2
  }
  }, {
  "3" : {
  "id" : 3
   }
  } ],
   "height" : "134",
  "image" : "1",
  "is_active" : "1",
  "layer_count" : "3",
  "name" : "1",
  "symbol_keywords" : [ {
  "keyword_id" : 0
  }, {
  "keyword_id" : 11
  }, {
  "keyword_id" : 21
   }, {
  "keyword_id" : 31
    }, {
  "keyword_id" : 41
  }, {
  "keyword_id" : 51
 } ],
  "symbol_layers" : [ {
  "cmyk" : "0,0,0,70",
   "height" : "71",
  "hexa" : "706F6F",
   "layer" : "1",
  "rgb" : "112,111,111",
  "symbol_id" : "1",
  "width" : "126",
  "xpos" : "107",
  "ypos" : "59"
   }, {
   "cmyk" : "0,70,20,0",
   "height" : "66",
  "hexa" : "ED6D91",
  "layer" : "2",
  "rgb" : "237,109,145",
    "symbol_id" : "1",
     "width" : "66",
   "xpos" : "158",
   "ypos" : "59"
    }, {
   "cmyk" : "0,80,40,0",
   "height" : "12",
   "hexa" : "EA516D",
   "layer" : "3",
   "rgb" : "234,81,109",
   "symbol_id" : "1",
   "width" : "15",
    "xpos" : "110",
   "ypos" : "78"
     } ],
    "symbol_text" : [ {
   "align" : "center",
   "bold" : "0",
   "cmyk" : "0,80,40,0",
   "color" : "EA516D",
   "font" : "gabrielle",
   "height" : "48",
    "italic" : "0",
   "line" : "CompanyName",
   "rgb" : "234,81,109",
   "size" : "75",
   "text" : "1",
   "underline" : "0",
   "width" : "400",
   "xpos" : "0",
    "ypos" : "160"
      }, {
   "align" : "center",
   "bold" : "0",
   "cmyk" : "0,0,0,70",
   "color" : "706F6F",
   "font" : "quicksand_book",
   "height" : "35",
   "italic" : "0",
   "line" : "YOUR SLOGAN",
   "rgb" : "112,111,111",
   "size" : "20",
   "text" : "2",
   "underline" : "0",
   "width" : "400",
   "xpos" : "0",
   "ypos" : "244"
    } ],
    "variant_of" : "0",
   "weightage" : "75",
     "width" : "239",
    "xpos" : "100",
   "ypos" : "40"
   }, {
      "categories" : [ {
     "4" : {
     "id" : 4
     }
     }, {
   "5" : {
  "id" : 5
    }
  } ],
   "height" : "120",
  "image" : "2",
  "is_active" : "1",
  "layer_count" : "3",
 "name" : "1",
 "symbol_keywords" : [ {
   "keyword_id" : 0
  }, {
  "keyword_id" : 1
   }, {
  "keyword_id" : 2
 }, {
  "keyword_id" : 3
   }, {
   "keyword_id" : 4
  }, {
 "keyword_id" : 5
  } ],
  "symbol_layers" : [ {
  "cmyk" : "0,0,0,70",
  "height" : "71",
  "hexa" : "706F6F",
  "layer" : "1",
  "rgb" : "112,111,111",
  "symbol_id" : "1",
  "width" : "126",
  "xpos" : "107",
   "ypos" : "59"
  }, {
  "cmyk" : "0,70,20,0",
  "height" : "66",
  "hexa" : "ED6D91",
  "layer" : "2",
  "rgb" : "237,109,145",
  "symbol_id" : "1",
  "width" : "66",
  "xpos" : "158",
  "ypos" : "59"
    }, {
  "cmyk" : "0,80,40,0",
  "height" : "12",
  "hexa" : "EA516D",
  "layer" : "3",
   "rgb" : "234,81,109",
  "symbol_id" : "1",
  "width" : "15",
  "xpos" : "110",
  "ypos" : "78"
  } ],
  "symbol_text" : [ {
  "align" : "center",
  "bold" : "0",
  "cmyk" : "0,80,40,0",
  "color" : "EA516D",
  "font" : "gabrielle",
  "height" : "48",
  "italic" : "0",
  "line" : "CompanyName",
  "rgb" : "234,81,109",
  "size" : "75",
  "text" : "1",
  "underline" : "0",
  "width" : "400",
  "xpos" : "0",
  "ypos" : "160"
  }, {
   "align" : "center",
  "bold" : "0",
  "cmyk" : "0,0,0,70",
  "color" : "706F6F",
  "font" : "quicksand_book",
  "height" : "35",
  "italic" : "0",
  "line" : "YOUR SLOGAN",
  "rgb" : "112,111,111",
  "size" : "20",
  "text" : "2",
  "underline" : "0",
  "width" : "400",
  "xpos" : "0",
  "ypos" : "244"
   } ],
   "variant_of" : "0",
    "weightage" : "75",
   "width" : "239",
   "xpos" : "100",
   "ypos" : "40"
   } ]

i have this db structure where a symbol can have multiple categories and multiple symbol_keywords.Now i want to query symbols on the basis of specific categories id and specific keyword_id through rest api.is this possible if yes,how? or restructuring of db is required

Shahrukh
  • 102
  • 5
  • A Firebase query can only contain a single orderBy. So you'll have to adapt your data to allow the query you're looking to build. See http://stackoverflow.com/questions/26700924/query-based-on-multiple-where-clauses-in-firebase. – Frank van Puffelen Sep 30 '16 at 14:37
  • In addition: Also: You've included a picture of the JSON tree in your question. Please replace that with the actual JSON as text, which you can easily get by clicking the Export button in your Firebase Database console. Having the JSON as text makes it searchable, allows us to easily use it to test with your actual data and use it in our answer and in general is just a Good Thing to do. – Frank van Puffelen Sep 30 '16 at 14:37
  • @Frank van Puffelen i have provided the actual json.ok i will keep the symbols under category_id.so that i will have to use only one orderby but even with only one orderby how can i search a symbol with a specific keyword_id,as every symbol have multiple keyword_id inside symbol_keywords – Shahrukh Oct 03 '16 at 06:29

0 Answers0