MongoDB finden Sie im array

Ich habe eine mongodb JSON-array und ich habe Probleme Ortung Kategorien, zB.

{ name:"hoyts"}

Habe ich versucht {categories.name:"hoyts"} und ein paar andere, aber nichts scheint zu funktionieren.

Dies ist mein JSON:

   {
   "_id": ObjectId("4f67da1538fc5d7347000000"),
   "categories": {
     "id": 1,
     "name": "hoyts",
     "product-logo": "http: \/\/www.incard.com.au\/newsite\/template\/images\/movieticket\/4cinemas\/hoytstop.png",
     "products"▼: {
       "0": {
         "barcode": "25001",
         "name": "GoldClass",
         "Price": "12.00",
         "CashBack": "2.00" 
      },
       "1": {
         "barcode": "25002",
         "name": "Weekday",
         "Price": "12.00",
         "CashBack": "2.00" 
      },
       "2": {
         "barcode": "25003",
         "name": "Weekend",
         "Price": "24.00",
         "CashBack": "4.00" 
      } 
    } 
  },
   "store_name": "movies",
   "1": {
     "id": 2,
     "name": "village",
     "logo": "village.png",
     "products": {
       "0": {
         "barcode": "26001",
         "name": "GoldClass",
         "Price": "12.00",
         "CashBack": "2.00" 
      },
       "1": {
         "barcode": "26002",
         "name": "Weekday",
         "Price": "12.00",
         "CashBack": "2.00" 
      },
       "2": {
         "barcode": "26003",
         "name": "Weekend",
         "Price": "24.00",
         "CashBack": "4.00" 
      } 
    } 
  } 
}
  • was ist 'array()' ? können Sie nach echtes JSON ?
  • Ich brauche nur auf die Produkte zurück, für die hoyts
Schreibe einen Kommentar