Skip to content

Commit 0027f2a

Browse files
committed
changed document to use mongodb one
1 parent a068770 commit 0027f2a

File tree

4 files changed

+8
-9
lines changed

4 files changed

+8
-9
lines changed

packages/compass-indexes/src/components/create-index-form/create-index-form.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import { usePreference } from 'compass-preferences-model/provider';
2121
import IndexFlowSection from './index-flow-section';
2222
import QueryFlowSection from './query-flow-section';
2323
import toNS from 'mongodb-ns';
24-
import type { Document as BsonDocument } from 'bson';
24+
import type { Document } from 'mongodb';
2525

2626
const createIndexModalFieldsStyles = css({
2727
margin: `${spacing[600]}px 0 ${spacing[800]}px 0`,
@@ -50,7 +50,7 @@ export type CreateIndexFormProps = {
5050
onRemoveFieldClick: (idx: number) => void; // Minus icon.
5151
onTabClick: (tab: Tab) => void;
5252
showIndexesGuidanceVariant?: boolean;
53-
query: BsonDocument | null;
53+
query: Document | null;
5454
};
5555

5656
function CreateIndexForm({

packages/compass-indexes/src/components/create-index-form/query-flow-section.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import {
77
useFocusRing,
88
ParagraphSkeleton,
99
} from '@mongodb-js/compass-components';
10-
import type { Document as BsonDocument } from 'bson';
10+
import type { Document } from 'mongodb';
1111
import React, { useMemo, useCallback } from 'react';
1212
import { css, spacing } from '@mongodb-js/compass-components';
1313
import {
@@ -107,7 +107,7 @@ const QueryFlowSection = ({
107107
}: SuggestedIndexFetchedProps) => Promise<void>;
108108
indexSuggestions: Record<string, number> | null;
109109
fetchingSuggestionsState: IndexSuggestionState;
110-
initialQuery: BsonDocument | null;
110+
initialQuery: Document | null;
111111
}) => {
112112
const [inputQuery, setInputQuery] = React.useState(
113113
JSON.stringify(initialQuery ?? '', null, 2)

packages/compass-indexes/src/components/create-index-modal/create-index-modal.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,14 @@ import {
2929
import { useConnectionInfoRef } from '@mongodb-js/compass-connections/provider';
3030
import { usePreference } from 'compass-preferences-model/provider';
3131
import CreateIndexModalHeader from './create-index-modal-header';
32-
import type { Document as BsonDocument } from 'bson';
32+
import type { Document } from 'mongodb';
3333

3434
type CreateIndexModalProps = React.ComponentProps<typeof CreateIndexForm> & {
3535
isVisible: boolean;
3636
namespace: string;
3737
error: string | null;
3838
currentTab: Tab;
39-
query: BsonDocument | null;
39+
query: Document | null;
4040
onErrorBannerCloseClick: () => void;
4141
onCreateIndexClick: () => void;
4242
onCancelCreateIndexClick: () => void;

packages/compass-indexes/src/modules/create-index.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import type { Document } from 'mongodb';
2-
import type { Document as BsonDocument } from 'bson';
32
import { EJSON, ObjectId } from 'bson';
43
import type { CreateIndexesOptions, IndexDirection } from 'mongodb';
54
import { isCollationValid } from 'mongodb-query-parser';
@@ -77,7 +76,7 @@ type ErrorClearedAction = {
7776

7877
export type CreateIndexOpenedAction = {
7978
type: ActionTypes.CreateIndexOpened;
80-
query?: BsonDocument;
79+
query?: Document;
8180
};
8281

8382
type CreateIndexClosedAction = {
@@ -314,7 +313,7 @@ export type State = {
314313
sampleDocs: Array<Document> | null;
315314

316315
// base query to be used for query flow index creation
317-
query: BsonDocument | null;
316+
query: Document | null;
318317
};
319318

320319
export const INITIAL_STATE: State = {

0 commit comments

Comments
 (0)