In my collection(collection name is "node"). And this collection contains following documents :
{
"GEOLOCATION": {
"GEO_CODE": [],
"ACTIVE_GEOLOCATION": false
},
"META": {
"CATEGORY": "levis",
"DESCRIPTION": "dsad",
"PRIVACY": "PUBLIC",
"TEMPLATE_NAME": "A",
"TEMPLATE_GROUP": "Product",
"KEYWORDS": ["sda"],
"CREATEDBY": "",
"SUBCATEGORY": "Blue",
"PRODUCT_TEMPLATE_TYPE": "Consumable",
"UOM": "",
"TEMPLATE_SUBGROUP": ""
},
"VARIENTS": [{
"COMMENT": "Demo",
"INDEX": 0,
"NAME": "Price",
"IS_PARENT": false,
"DATATYPE": "Text",
"ACCESS": "PUBLIC",
"PARENT_VARIENT": "Parem",
"TYPE": "PERMANENT"
}]
}
I want do a query so that I can fetch keys form geolocation, Meta
.
For example in my query I want to pass Meta
and want to fetch only keys likes :
CATEGORY,DESCRIPTION, PRIVACY,TEMPLATE_NAME,TEMPLATE_GROUP
.
For achieving this I run following query :
Object.keys(db.nodes.findOne())
But it shows following result :
[ "_id", "GEOLOCATION", "META", "VARIENTS" ]
Above result not expected result I want some thing like this,
expected output :
[CATEGORY,DESCRIPTION, PRIVACY,TEMPLATE_NAME,TEMPLATE_GROUP] // META object values.