More dev-friendly operations in Web Admin
I'd love to see a few things added to the web admin that would make early development easier. They might be the sorts of things you'd disable or not recommend for production, but having them available would help greatly speed up development and debugging. There are some things I need to do regularly that are tedious:
Delete all documents in a bucket (instead of having to delete the bucket and re-create it, and re-install all my views). If I'm working on a new feature, it is easy for a bug or design change to require me to wipe my previous data and start over. I find myself needing this a lot. Even cooler would be a 'Delete all documents with keys that match a regex'. Queries on documents based on regex would also be awesome. The key range start/end is too limited for quick adhoc lookups.
Great ideas!
Actually we already have the delete all Documents in a bucket feature, but we disable it by default so it's not done accidentally. In 2.0, if you click on Data Buckets tab, click on the triangle next to the bucket name to expand. On the right, click on Edit and near the bottom of the popup modal there is a checkbox for Flush, check the box and click Save. Now click Edit again and in the Modal on the bottom left there is now a Flush button, click it to Delete all data in the Bucket. This is what you want.
Also you can Flush from the SDK as well, but it needs to be enabled with the checkbox first. The reasoning is that it's very easy to execute a flush command so we protect it so that people don't accidentally delete all their data.
The RegEx idea is cool. I actually do this through a MapReduce View. In my map function I index the documents based on the key/regex, or a .startsWith type deal on the meta.id or whatever. Then in my app Test code, or wherever, I pull the View with stale=false and iteratively delete them all. Not hard to do.
We are working on a query language for ad hoc querying, so this would be easy to do in the future in creative ways :)
@scalabl3
Technical Evangelist
Couchbase Inc.