I’ve dropped the _default collection in the _default scope of the 7.0.3 Couchbase. And can’t create it back because it’s forbidden to start the collection name from _ or %. And at the same time my indexes don’t work so I need to create it back but can’t. Tried to use couchbase-cli and curl but they didn’t help.
@maksymfedosov This does not appear to be supported – which is strange in this context because of course you would expect that if you dropped something you could recreate it later. I think the idea is collections starting with _ are supposed to be system-owned.
Maybe @vsr1 or @bingjie.miao or @Marco_Greco can confirm what the intent is, and whether there is some barrier to supporting this or if it makes sense to open a bug for this case (and similar case for _default scope).
_ starting is reserved for system scope/collections and created as part of bucket creation. User don’t have authorization to re-create. _default scope, _default collection are meant backward compatibility (to support pre-collection based queries, kv ops).
This is more related to kv / ns_server than query: couchbase-cli collection-manage would have the same issues, and it bypasses query entirely.
Recreate the bucket and move the data, or restore - I know, neither of those are practical or pleasant alternatives…
thank you for the suggestions, I can remove the bucket and recreate it without any problems. But the problem is that another person is responsible for it and it’ll take some time, but it’s nothing crucial.
But the question is, why can I remove this collection with couchbase-cli and using curl if I can’t create it back. It would be useful to restrict this option if it’s possible and prudent.
Thank you for your help and attention to my problem. I hope that it won’t be too much so prominent users like I am )))
_default is for backward compatibility.
Also there is limit on number of scopes/collections per cluster.
If started directly on 7.0.0+ server or already migrated data/indexes/applications old bucket model to collection model one can drop _default and not count towards those limit.