Skip to content

[mongodb] Fix bulkWrite operation types#45492

Merged
typescript-bot merged 1 commit intoDefinitelyTyped:masterfrom
avaly:mongodb/fix-bulkWrite
Jun 19, 2020
Merged

[mongodb] Fix bulkWrite operation types#45492
typescript-bot merged 1 commit intoDefinitelyTyped:masterfrom
avaly:mongodb/fix-bulkWrite

Conversation

@avaly
Copy link
Copy Markdown
Contributor

@avaly avaly commented Jun 15, 2020

Please fill in this template.

  • Use a meaningful title for the pull request. Include the name of the package modified.
  • Test the change in your own code. (Compile and run.)
  • Add or edit tests to reflect the change. (Run with npm test.)
  • Follow the advice from the readme.
  • Avoid common mistakes.
  • Run npm run lint package-name (or tsc if no tslint.json is present).

If changing an existing definition:


Changes in this PR:

  • insertOne operations should also accept objects without _id - these will get a new _id generated by mongo server

@typescript-bot typescript-bot added Where is GH Actions? GH Actions didn't give a response to this PR Popular package This PR affects a popular package (as counted by NPM download counts). Author is Owner The author of this PR is a listed owner of the package. labels Jun 15, 2020
@typescript-bot
Copy link
Copy Markdown
Contributor

typescript-bot commented Jun 15, 2020

@avaly Thank you for submitting this PR!

Code Reviews

Because you edited one package and updated the tests (👏), I can help you merge this PR once someone else signs off on it.

Status

  • ✅ No merge conflicts
  • ✅ Continuous integration tests have passed
  • ✅ Most recent commit is approved by type definition owners or DT maintainers

All of the items on the list are green. To merge, you need to post a comment including the string "Ready to merge" to bring in your changes.


Diagnostic Information: What the bot saw about this PR
{
  "type": "info",
  "now": "-",
  "pr_number": 45492,
  "author": "avaly",
  "owners": [
    "CaselIT",
    "alanmarcell",
    "dante-101",
    "mcortesi",
    "EnricoPicci",
    "AJCStriker",
    "julien-c",
    "daprahamian",
    "denys-bushulyak",
    "BastienAr",
    "sindbach",
    "geraldinelemeur",
    "various89",
    "angela-1",
    "hector7",
    "floric",
    "erikc5000",
    "Manc",
    "jloveridge",
    "ranguna",
    "HosseinAgha",
    "albertossilva",
    "peterblazejewicz",
    "LinusU",
    "taxilian",
    "xamgore",
    "avaly",
    "HitkoDev",
    "jtassin"
  ],
  "dangerLevel": "ScopedAndTested",
  "headCommitAbbrOid": "0a788da",
  "headCommitOid": "0a788dafce2afd5d1b9eaa19bb9276c6a71f007a",
  "mergeIsRequested": true,
  "stalenessInDays": 1,
  "lastCommitDate": "2020-06-18T14:46:38.000Z",
  "lastCommentDate": "2020-06-19T16:18:27.000Z",
  "reviewLink": "https://github.com/DefinitelyTyped/DefinitelyTyped/pull/45492/files",
  "hasMergeConflict": false,
  "authorIsOwner": true,
  "isFirstContribution": false,
  "popularityLevel": "Popular",
  "anyPackageIsNew": false,
  "packages": [
    "mongodb"
  ],
  "files": [
    {
      "filePath": "types/mongodb/index.d.ts",
      "kind": "definition",
      "package": "mongodb"
    },
    {
      "filePath": "types/mongodb/test/collection/bulkWrite.ts",
      "kind": "test",
      "package": "mongodb"
    }
  ],
  "hasDismissedReview": false,
  "ciResult": "pass",
  "lastReviewDate": "2020-06-19T16:10:38.000Z",
  "reviewersWithStaleReviews": [],
  "approvalFlags": 2,
  "isChangesRequested": false
}

@typescript-bot
Copy link
Copy Markdown
Contributor

@danger-public
Copy link
Copy Markdown

danger-public commented Jun 15, 2020

Inspecting the JavaScript source for this package found some properties that are not in the .d.ts files.
The check for missing properties isn't always right, so take this list as advice, not a requirement.

mongodb (unpkg)

was missing the following properties:

  1. The declaration doesn't match the JavaScript module 'mongodb'. Reason:
    The JavaScript module can be called or constructed, but the declaration module cannot.

The most common way to resolve this error is to use 'export =' syntax.
To learn more about 'export =' syntax, see https://www.typescriptlang.org/docs/handbook/modules.html#export--and-import--require.

  1. MongoTimeoutError
  2. MongoServerSelectionError
  3. MongoWriteConcernError
  4. MongoBulkWriteError
as well as these 11 other properties...

BulkWriteError, Admin, Collection, GridStore, Chunk, CoreServer, CoreConnection, Map, Symbol, BSONRegExp, instrument

Generated by 🚫 dangerJS against 0a788da

@typescript-bot typescript-bot removed the Where is GH Actions? GH Actions didn't give a response to this PR label Jun 15, 2020
@typescript-bot
Copy link
Copy Markdown
Contributor

👋 Hi there! I’ve run some quick measurements against master and your PR. These metrics should help the humans reviewing this PR gauge whether it might negatively affect compile times or editor responsiveness for users who install these typings.

Let’s review the numbers, shall we?

Comparison details 📊
master #45492 diff
Batch compilation
Memory usage (MiB) 87.0 87.6 +0.7%
Type count 15969 16107 +1%
Assignability cache size 3808 3845 +1%
Language service
Samples taken 2195 2238 +2%
Identifiers in tests 2195 2238 +2%
getCompletionsAtPosition
    Mean duration (ms) 294.0 331.7 +12.8%
    Mean CV 8.5% 8.7%
    Worst duration (ms) 381.8 437.4 +14.6%
    Worst identifier compression $mul
getQuickInfoAtPosition
    Mean duration (ms) 296.4 332.3 +12.1%
    Mean CV 9.3% 9.0% -3.9%
    Worst duration (ms) 399.0 450.8 +13.0%
    Worst identifier url find

It looks like nothing changed too much. I won’t post performance data again unless it gets worse.

@typescript-bot typescript-bot added the Perf: Same typescript-bot determined that this PR will not significantly impact compilation performance. label Jun 15, 2020
@avaly avaly force-pushed the mongodb/fix-bulkWrite branch from 1f7c000 to 0a788da Compare June 18, 2020 14:46
@typescript-bot typescript-bot added Owner Approved A listed owner of this package signed off on the pull request. Self Merge This PR can now be self-merged by the PR author or an owner labels Jun 19, 2020
@typescript-bot
Copy link
Copy Markdown
Contributor

@avaly Everything looks good here. Great job! I am ready to merge this PR on your behalf.

If you'd like that to happen, please post a comment saying:

Ready to merge

and I'll merge this PR almost instantly. Thanks for helping out! ❤️

@avaly
Copy link
Copy Markdown
Contributor Author

avaly commented Jun 19, 2020

Ready to merge

@typescript-bot typescript-bot merged commit e5fcac4 into DefinitelyTyped:master Jun 19, 2020
@avaly avaly deleted the mongodb/fix-bulkWrite branch June 19, 2020 16:18
@typescript-bot
Copy link
Copy Markdown
Contributor

I just published @types/mongodb@3.5.23 to npm.

vanessayuenn pushed a commit to vanessayuenn/DefinitelyTyped that referenced this pull request Jun 23, 2020
ngbrown pushed a commit to ngbrown-forks/DefinitelyTyped that referenced this pull request Jul 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Author is Owner The author of this PR is a listed owner of the package. Owner Approved A listed owner of this package signed off on the pull request. Perf: Same typescript-bot determined that this PR will not significantly impact compilation performance. Popular package This PR affects a popular package (as counted by NPM download counts). Self Merge This PR can now be self-merged by the PR author or an owner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants