How to delete all tables under a user in Couchbase?

To delete all tables under a user in Couchbase, you can follow these steps:

  1. Log in to the Couchbase Admin Console using the administrator account.
  2. Navigate to the “Data” tab.
  3. Choose the Bucket where the user to be deleted is located.
  4. Choose the “Search” tab on the detailed information page of the Bucket.
  5. Use the editor on the search page to enter the following N1QL query to list all tables owned by the user.
SELECT DISTINCT meta().id 
FROM `bucket_name` 
WHERE meta().id LIKE "user::%"

Replace bucket_name with the name of the Bucket for the table you want to delete.

  1. Click on the “search” button to perform the search.
  2. Choose and delete all tables that start with “user::” in the query results.

Please note that this will delete all tables owned by the user, including data and indexes. Before executing the delete operation, please make sure to back up all relevant data and consider the consequences of the deletion.

bannerAds