I have a mongoDB collection with a field called "Url". There are many records in this collection. Inside this field, it always contains this text below:
"http://image-assets.s3.us-west-2.amazonaws.com/" For example "http://image-assets.s3.us-west-2.amazonaws.com/folder1/folder2/blah.jpg"
I would like to remove the portion of "http://image-assets.s3.us-west-2.amazonaws.com/", so the final result should look like "folder1/folder2/blah.jpg"
I would like to write a mongodb update statement, I don't know where to start. I can think of two things: (a) remove the first x number of characters, or (b) replace the text with a null. However the text includes a lot of slashes (/)
Your help is appreciated.
See Question&Answers more detail:os