0

I have a data set like this:

{
        "_id" : ObjectId("5a7abf6b3b808dbed05d4359"),
        "Name" : "Nil",
        "TEST" : "APPLE",
        "Group" : "Nil",
        "Sector" : "Nil"
},
{
        "_id" : ObjectId("5a7abf6b3b808dbed05d435a"),
        "Name" : "Nil",
        "TEST" : "ORRANGE",
        "Group" : "Nil",
        "Sector" : "Nil"
}

Now I want to add Prefix on TEST Keys for all entries in Column. Expected Result will be like this:

{
            "_id" : ObjectId("5a7abf6b3b808dbed05d4359"),
            "Name" : "Nil",
            "TEST" : "@APPLE",
            "Group" : "Nil",
            "Sector" : "Nil"
    },
    {
            "_id" : ObjectId("5a7abf6b3b808dbed05d435a"),
            "Name" : "Nil",
            "TEST" : "@ORRANGE",
            "Group" : "Nil",
            "Sector" : "Nil"
    }

I want to add @ for all on TEST. Any help is appreciated

mohan08p
  • 5,002
  • 1
  • 28
  • 36
Ankit
  • 951
  • 1
  • 9
  • 29
  • You want to add '@' to whatever is inserted into the "TEST column? If yes, just do it before you save your document on mongo.. – jpgrassi Feb 07 '18 at 09:29
  • Dear I have an entry without @ on my db. And I want to make all entry change from normal to prefix i.e @ – Ankit Feb 07 '18 at 09:33

0 Answers0