@@ -6,19 +6,19 @@ import type { MongoServerError } from 'mongodb';
66import semver from 'semver' ;
77import StateMixin from '@mongodb-js/reflux-state-mixin' ;
88import type { Element } from 'hadron-document' ;
9- import { Document } from 'hadron-document' ;
10- import { validate } from 'mongodb-query-parser' ;
11- import HadronDocument from 'hadron-document' ;
9+ import HadronDocument , { Document } from 'hadron-document' ;
10+ import { toJSString , validate } from 'mongodb-query-parser' ;
1211import _parseShellBSON , { ParseMode } from '@mongodb-js/shell-bson-parser' ;
1312import type { PreferencesAccess } from 'compass-preferences-model/provider' ;
1413import { capMaxTimeMSAtPreferenceLimit } from 'compass-preferences-model/provider' ;
1514import type { Stage } from '@mongodb-js/explain-plan-helper' ;
1615import { ExplainPlan } from '@mongodb-js/explain-plan-helper' ;
16+ import { EJSON } from 'bson' ;
1717import type {
18- FavoriteQueryStorageAccess ,
1918 FavoriteQueryStorage ,
20- RecentQueryStorageAccess ,
19+ FavoriteQueryStorageAccess ,
2120 RecentQueryStorage ,
21+ RecentQueryStorageAccess ,
2222} from '@mongodb-js/my-queries-storage/provider' ;
2323
2424import {
@@ -29,22 +29,22 @@ import {
2929
3030import type { DOCUMENTS_STATUSES } from '../constants/documents-statuses' ;
3131import {
32- DOCUMENTS_STATUS_INITIAL ,
33- DOCUMENTS_STATUS_FETCHING ,
3432 DOCUMENTS_STATUS_ERROR ,
35- DOCUMENTS_STATUS_FETCHED_INITIAL ,
3633 DOCUMENTS_STATUS_FETCHED_CUSTOM ,
34+ DOCUMENTS_STATUS_FETCHED_INITIAL ,
3735 DOCUMENTS_STATUS_FETCHED_PAGINATION ,
36+ DOCUMENTS_STATUS_FETCHING ,
37+ DOCUMENTS_STATUS_INITIAL ,
3838} from '../constants/documents-statuses' ;
3939
4040import type { UpdatePreview } from 'mongodb-data-service' ;
4141import type { GridStore , TableHeaderType } from './grid-store' ;
4242import configureGridStore from './grid-store' ;
4343import type { TypeCastMap } from 'hadron-type-checker' ;
4444import type AppRegistry from 'hadron-app-registry' ;
45+ import type { ActivateHelpers } from 'hadron-app-registry' ;
4546import { BaseRefluxStore } from './base-reflux-store' ;
4647import { openToast , showConfirmation } from '@mongodb-js/compass-components' ;
47- import { toJSString } from 'mongodb-query-parser' ;
4848import {
4949 openBulkDeleteFailureToast ,
5050 openBulkDeleteProgressToast ,
@@ -59,7 +59,6 @@ import type {
5959 MongoDBInstance ,
6060} from '@mongodb-js/compass-app-stores/provider' ;
6161import configureActions from '../actions' ;
62- import type { ActivateHelpers } from 'hadron-app-registry' ;
6362import type { Logger } from '@mongodb-js/compass-logging/provider' ;
6463import { mongoLogId } from '@mongodb-js/compass-logging/provider' ;
6564import type { CollectionTabPluginMetadata } from '@mongodb-js/compass-collection' ;
@@ -1834,7 +1833,9 @@ class CrudStoreImpl
18341833 }
18351834
18361835 openCreateIndexModal ( ) {
1837- this . localAppRegistry . emit ( 'open-create-index-modal' ) ;
1836+ this . localAppRegistry . emit ( 'open-create-index-modal' , {
1837+ query : EJSON . serialize ( this . queryBar . getLastAppliedQuery ( 'crud' ) ) ,
1838+ } ) ;
18381839 }
18391840
18401841 openCreateSearchIndexModal ( ) {
@@ -1999,6 +2000,7 @@ export type DocumentsPluginServices = {
19992000 queryBar : QueryBarService ;
20002001 collection : Collection ;
20012002} ;
2003+
20022004export function activateDocumentsPlugin (
20032005 options : CrudStoreOptions ,
20042006 {
@@ -2125,6 +2127,7 @@ type ErrorOrResult =
21252127 result : undefined
21262128 ]
21272129 | [ error : undefined | null , result : BSONObject ] ;
2130+
21282131export async function findAndModifyWithFLEFallback (
21292132 ds : DataService ,
21302133 ns : string ,
0 commit comments