Friday, 17 March 2017

How can i remove html tage inside field using mongodb command?

I have a collection Test and data hase stored like this

  {
    "_id": {
        "$oid": "58cba49d689493500be8d0a5"
    },
    "Latitude": 12.96009039,
    "Longitude": 77.55213396,
    "InfoHTML": "<br/>Polling Station No and Name : 131 43 Ward Office (Revenue),B B M P, Room No-01   <br/><br/><a href='http://psleci.nic.in/pslinfoc.aspx?S=S10&A=168&P=131 ' target='_blank'><b>Click here for information<b><\/a>",
    "state": "karnataka",
    "district": "bbmpcentral",
    "constituency": "chamrajpet"
},
{
    "_id": {
        "$oid": "58cba645734d1d2ca8573b20"
    },
    "Latitude": 12.96001673,
    "Longitude": 77.55207344,
    "InfoHTML": "<br/>Polling Station No and Name : 132 43 Ward Office (Revenue),B B M P, Room No-02   <br/><br/><a href='http://psleci.nic.in/pslinfoc.aspx?S=S10&A=168&P=132 ' target='_blank'><b>Click here for information<b><\/a>",
    "state": "karnataka",
    "district": "bbmpcentral",
    "constituency": "chamrajpet"
},
{
    "_id": {
        "$oid": "58cbaa4d734d1d2ca8573c9b"
    },
    "Latitude": 12.96519429,
    "Longitude": 77.58097308,
    "InfoHTML": "<br/>Polling Station No and Name : 11 Abbas Khan Womens College, Darga Compound,   <br/><br/><a href='http://psleci.nic.in/pslinfoc.aspx?S=S10&A=169&P=11 ' target='_blank'><b>Click here for information<b><\/a>",
    "state": "karnataka",
    "district": "bbmpcentral",
    "constituency": "chickpet"
}

if you see InfoHtml field inside the document it contains html tags i want to remove all html tags

 "InfoHTML": "<br/>Polling Station No and Name : 131 43 Ward Office (Revenue),B B M P, Room No-01   <br/><br/><a href='http://psleci.nic.in/pslinfoc.aspx?S=S10&A=168&P=131 ' target='_blank'><b>Click here for information<b><\/a>"

my expectation i should get InfoHTML in every document like this

for example i given

"InfoHTML": "Polling Station No and Name : 11 Abbas Khan Womens College, Darga Compound",

is it possible to remove html tags mongodb.



via its me

No comments:

Post a Comment