i have got one json. i want to read it in following formate

  • Thread starter Thread starter rajemessage
  • Start date Start date
R

rajemessage

Guest
hi , ihave following json in mongo db.

i can get the rows from mongo db but then i have to do this in c# core.

id:1

/**
* Paste one or more documents here
*/
{
"nodeHierarchy": {
"L1": "Mechanical"
},

"weightage": {
"$numberDouble": "100"
},
"dateFrom": {
"$date": {
"$numberLong": "1581445800000"
}
},
"dateTo": {
"$date": {
"$numberLong": "1582914600000"
}
},
"WSID": "PRJ1",
"scope": {
"$numberDecimal": "1000"
},
"IsLeafNode": false
}




id:2

/**
* Paste one or more documents here
*/
{
"nodeHierarchy": {
"L1": "Mechanical",
"L2": "Act1"
},
"weightage": {
"$numberDouble": "100"
},
"dateFrom": {
"$date": {
"$numberLong": "1581445800000"
}
},
"dateTo": {
"$date": {
"$numberLong": "1582914600000"
}
},
"WSID": "PRJ1",
"scope": {
"$numberDecimal": "1000"
},
"IsLeafNode": true
}


i have many rows in above formate, but i have take only two rows for brevity,

the first row is parent row which has "L1":mechenical, and second row is child of "mechenical" which is at "L2":"Act1"

this heirarchy could be at n level.

what i have to do is i have to get the child row the last row by filltering "IsleafNode"; true and then divide the weitage of child node with weitage of parent row, and then so on, till i get the top most parent.

how can do it in c# core.

yours sincerley

Continue reading...
 
Back
Top