Reputation: 3236
I have a couchDB database, in my documents I have a series of strings (stored as JSON objects) unfortunately during the submission the strings were escaped so that "\n" is inserted as "\\n" into the database.
Is it possible to run a search and replace operation to reverse this?
Upvotes: 2
Views: 435
Reputation: 28439
No, you can't perform a "search and replace" like you are probably thinking. Your best bet is to use the bulk document API to write changes to multiple documents simultaneously.
You'll need some sort of script to query all docs (or you could write a view to find those that need to be updated) and then you'll submit your changes via the bulk docs API.
Upvotes: 3