-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[#1815] Add "distinct" param to datastore_search
This allows the users to get only the distinct values of the query. The "total" field on the returned data is related to all fields, not only the distincts. For example, in our test we have the data: ```json [ {"author": "tolstoy", "title": "Anna Karenina"}, {"author": "tolstoy", "title": "War and Peace"} ] ``` We want to get a list with all authors on the datastore resource. Then we query the "datastore_search" with: ```json { "resource_id": "the_resource_id", "fields": ["author"], "distinct": True } ``` The result is; ```json { "success": True, "total": 2, "records": [{"author": "tolstoy"}] } ``` Note that even though there's only one returned record, the "total" field is 2. This is because "total" doesn't take into account the distinct values, but all rows that match our query.
- Loading branch information
1 parent
41f67a0
commit 6071824
Showing
5 changed files
with
30 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters