I have alot of mongodb documents in a collection ABC of the form:
{
....
"URL":"www.abc.com/helloWorldt/..."
.....
}
I want to replace helloWorldt with helloWorld Final Output:
{
....
"URL":"www.abc.com/helloWorld/..."
.....
}
how do i achieve this for all documents in the collection ABC
Currently, you can't use the value of a field to update it. So you'll have to iterate through the documents and update each document using a function. There's an example of how you might do that here: MongoDB: Updating documents using data from the same document