Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions packages/compass-crud/src/stores/crud-store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1596,13 +1596,19 @@ class CrudStoreImpl

if (onApply) {
const { isTimeSeries, isReadonly } = this.state;
const { defaultSortOrder } = this.preferences.getPreferences();
this.track(
'Query Executed',
{
has_projection:
!!query.project && Object.keys(query.project).length > 0,
has_skip: (query.skip ?? 0) > 0,
has_sort: !!query.sort && Object.keys(query.sort).length > 0,
default_sort: !defaultSortOrder
? 'none'
: /_id/.test(defaultSortOrder)
? '_id'
: 'natural',
has_limit: (query.limit ?? 0) > 0,
has_collation: !!query.collation,
changed_maxtimems: query.maxTimeMS !== DEFAULT_INITIAL_MAX_TIME_MS,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ describe('Collection documents tab', function () {
has_projection: false,
has_skip: false,
has_sort: false,
default_sort: 'none',
mode: 'list',
used_regex: false,
});
Expand Down Expand Up @@ -219,6 +220,7 @@ describe('Collection documents tab', function () {
has_limit: true,
has_projection: true,
has_sort: true,
default_sort: 'none',
has_skip: true,
mode: 'list',
used_regex: false,
Expand Down
5 changes: 5 additions & 0 deletions packages/compass-telemetry/src/telemetry-events.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1735,6 +1735,11 @@ type QueryExecutedEvent = ConnectionScopedEvent<{
*/
has_sort: boolean;

/**
* Indicates which default sort was set in settings
*/
default_sort: 'natural' | '_id' | 'none';

/**
* Indicates whether the query includes a limit operation.
*/
Expand Down
Loading