Hi Sebastian,
I have a schema. I have fields for name, surname and title. There are about 20k data on this schema. I need to filter and fetch all unique title field.
for example: https://www.w3schools.com/sql/sql_distinct.asp
Thank you
Hi Sebastian,
I have a schema. I have fields for name, surname and title. There are about 20k data on this schema. I need to filter and fetch all unique title field.
for example: https://www.w3schools.com/sql/sql_distinct.asp
Thank you
And what should happen with the non-distinct values? I mean the other fields.
Example Datas;
Name | Surname | Title |
---|---|---|
Steve | Dainty | Doctor |
Rosa | White | Doctor |
Angelina | Pride | Computer Engineer |
Jack | Carney | Lawyer |
Select Distinct(title)
Result:
Title
Doctor
Computer Engineer
Lawyer
I expect it to not fetch other data.
I will have a look to it this Friday or next week.
i’m waiting… thank you.
I have not promised to implement it …
Can you describe me your use cases, the point is:
Hi Sebastian,
In fact, an improvement that can increase the quality of these queries may be needed by many people, such as filtering and returning unique values. I think that querying it directly at database level with an api and graphql method will give the best results. Your comments are important here. This will also simplify many issues in terms of directly receiving and using data for frontend etc. I also think that the development phase will not take much time. but still you know…
thanks for everything
You have not answered my question yet.
Actually, the third option you said is appropriate. Well, while creating the fields on the schema, if we mark them as index and create a directory on the mongo side, wouldn’t it provide performance for the related fields, and it would be nice with such a feature.
Create Schemas > Create Field Popup> ([X] Indexed) >> Mongo Index
Is such a feature possible?
It would be great if distinct is added on it.
You still have not answered my question. What is your use case?
If you need it for a website frontend, I am not sure if the performance will be good enough.
If you need it for another operation, like maintenance, it is not worth to implement this feature.
I recommend to put this data into an algolia index for that.
Yes and no.
There are so many problems with that (especially with the cloud):
How do you know that you need an index? You have to provide all the tooling that is also available to database administrators, because you need a deep understanding of the queries being made and the data structure to decide which index is the best. So you need a query analyzer, a list of slow queries and some charts like index size and so on to make a good decision.
Because indexes are not isolated (they live on the same machine), they basically fight for resources. If you create too many indexes the performance will become slower and therefore you have to isolate the apps from each other. Which means that each app would need its own database cluster and its own server cluster. Because the costs would explode otherwise, you would need a shared tier (like now) for the free plans and then migrate the data to dedicated servers for paid tiers. The paid tiers would probably in the pricing range of 150€, 500€, 800€. So very similar to contentful for example.
This topic was automatically closed after 2 days. New replies are no longer allowed.