display an array with find() method
Hi
Is there any tip to display an entire array with the find method ?
For an element given by its indice
db.tab_vol_json.add(
{ "_id" : "FE345_90",
"num_vol" :"AF6143",
"date_vol" :"2016-07-19",
"desc_vol" :
{"porte" : "20A",
"plan_vol" : {
"depart" : "21:45",
"parking" : "3R2",
"SID" : "AGN-2W",
"STAR" : "TOU-5T",
"arrivee" : null},
"sieges" :
[{"prenom" : "Guy",
"nom" : "Blanchet",
"siege" : "15A"},
{"prenom" : "Gerard",
"nom" : "Diffis",
"siege" : "15B"},
{"prenom" : "Victor",
"nom" : "Ferrage",
"siege" : "15C"}]
}
} )
mysql-js> db.tab_vol_json.find("date_vol = :dvol").
fields(["desc_vol.sieges[0].prenom","desc_vol.sieges[0].nom"]).
bind("dvol", "2016-07-19")
[
{
"desc_vol.sieges[0].nom": "Blanchet",
"desc_vol.sieges[0].prenom": "Guy"
}
]
1 document in set (0.01 sec)