display an array with find() method
Posted by: Christian Soutou
Date: August 31, 2016 09:04AM

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)

Options: ReplyQuote


Subject
Views
Written By
Posted
display an array with find() method
1180
August 31, 2016 09:04AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.