#community-help

On Aliasing Collections with Same Names

TLDR Aljosa suggested allowing an alias to have the same name as a collection. Jason explained the technical limitations for such a feature and future plans on alias functionality.

Powered by Struct AI
+11
pray1
4
19mo
Solved
Join the chat
Feb 04, 2022 (19 months ago)
Aljosa
Photo of md5-6bb7313b20c5179141d6908d6c09b2d5
Aljosa
06:55 PM
Currently it's not possible to create an alias with the same name as a collection. You have to create a new collection first (copy of the existing), delete the collection, create the alias and point it to the cloned collection.

I think the behavior of allowing an alias with the same name as the collection to be created would be more intuitive perhaps. It would automatically point to the collection of the same name and make it easier to transition from collections to aliases if you hadn't done so from the start.

Perhaps there is a technical reason why it's not possible though 🙂
Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
07:37 PM
The reason we can't do this is because when making an API call like

/collections/xyz/documents/search

we can't tell if the intent was to use the alias xyz or collection xyz if we allowed the same name to be used for both entities.
07:38
Jason
07:38 PM
We have plans to add more functionality to aliases (think properties to aliases) in the future and so it's important to be able to distinguish whether the user intended to use a collection name or an alias name.
pray1
Feb 06, 2022 (19 months ago)
Aljosa
Photo of md5-6bb7313b20c5179141d6908d6c09b2d5
Aljosa
07:09 AM
Understood 👌 thanks Jason!
+11