You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently is not possible to have multiple references to the same collection in a particular collection, therefore is not possible to have an N:M relation with the same collection. This ability is helpful for different use cases, for example:
A user have multiple managers and manage multiple users itself.
The typical Twitter followers use case: A user has followers and follow others itself
I would like to be able to make two kind of queries, for a certain user:
Return all the user documents of their followers.
Return all the user documents of the users they follow.
Currently, when you create a collection two references to the same collection, the collection is created as usual, but when you try to use include_fields, it works as it only one of the reference was taken into account.
For example, if you have:
Notice that the Following collection is created with the two references even if only one of them is taken into account. Failing with an explicit message about the restriction would be better, in my opinion.
Description
Currently is not possible to have multiple references to the same collection in a particular collection, therefore is not possible to have an N:M relation with the same collection. This ability is helpful for different use cases, for example:
I would like to be able to make two kind of queries, for a certain user:
Steps to reproduce
typesense-following.txt
Actual Behavior
Currently, when you create a collection two references to the same collection, the collection is created as usual, but when you try to use
include_fields
, it works as it only one of the reference was taken into account.For example, if you have:
Notice that the Following collection is created with the two references even if only one of them is taken into account. Failing with an explicit message about the restriction would be better, in my opinion.
Then you search with:
The results are like if
include_fields
always join using thefollower_id
, and there is no way to retrieve the followed user.Expected Behavior
I would like to be able to follow both references. Maybe an option could be something like having the possibility to set a name for the reference:
But this is just an idea, as I ignore the implementation details.
Metadata
Typesense Version: 26.0
OS: any
Source: Slack thread
The text was updated successfully, but these errors were encountered: