-
Notifications
You must be signed in to change notification settings - Fork 80
[WIP] use mql #2478
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
[WIP] use mql #2478
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,8 +27,6 @@ import type { | |
import type { ClientSideFieldLevelEncryptionOptions } from './field-level-encryption'; | ||
import type { AutoEncryptionOptions, Long, ObjectId, Timestamp } from 'mongodb'; | ||
import { shellApiType } from './enums'; | ||
import type { AbstractCursor } from './abstract-cursor'; | ||
import type ChangeStreamCursor from './change-stream-cursor'; | ||
import type { ShellBson } from './shell-bson'; | ||
import { inspect } from 'util'; | ||
|
||
|
@@ -851,7 +849,7 @@ export function addHiddenDataProperty<T = any>( | |
|
||
export async function iterate( | ||
results: CursorIterationResult, | ||
cursor: AbstractCursor<any, any> | ChangeStreamCursor, | ||
cursor: { isClosed(): boolean; tryNext(): Promise<Document | null> }, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good idea to specify smaller types. Didn't consider that. |
||
batchSize: number | ||
): Promise<CursorIterationResult> { | ||
if (cursor.isClosed()) { | ||
|
@@ -1298,6 +1296,7 @@ export type GenericServerSideSchema = { | |
locks: GenericCollectionSchema; | ||
databases: GenericCollectionSchema; | ||
tags: GenericCollectionSchema; | ||
actionlog: GenericCollectionSchema; | ||
}; | ||
local: { | ||
'system.version': GenericCollectionSchema; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -205,21 +205,21 @@ export default class Shard< | |
} | ||
} | ||
|
||
async _getConfigDB(): Promise<DatabaseWithSchema<M, M[keyof M]>> { | ||
async _getConfigDB(): Promise<DatabaseWithSchema<M, M['config']>> { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I went back and forth on exactly this change and I seemed to just trade one set of errors for another. Although I agree that M['config'] is more correct - it is what I tried first. |
||
const helloResult = await this._database._maybeCachedHello(); | ||
if (helloResult.msg !== 'isdbgrid') { | ||
await this._instanceState.printWarning( | ||
'MongoshWarning: [SHAPI-10003] You are not connected to a mongos. This command may not work as expected.' | ||
); | ||
} | ||
return this._database.getSiblingDB('config' as any); | ||
return this._database.getSiblingDB('config'); | ||
} | ||
|
||
@returnsPromise | ||
@apiVersions([1]) | ||
async status( | ||
verbose = false, | ||
configDB?: DatabaseWithSchema<M, M[keyof M]> | ||
configDB?: DatabaseWithSchema<M, M['config']> | ||
): Promise<CommandResult<ShardingStatusResult>> { | ||
const result = await getPrintableShardStatus( | ||
configDB ?? (await this._getConfigDB()), | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
aah this was what I was looking for!