mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
These deprecation warnings were introduced in mongodb@3.1.2: https://github.com/mongodb/node-mongodb-native/commit/a5d0f1d7e1 Fortunately, the deprecated Collection methods still work, and the deprecation relies on Node's require("util").deprecate API, which can be silenced permanently for a given function by temporarily setting `process.noDeprecation = true` while defining the function: https://github.com/nodejs/node/blob/2ae98ce7cb/lib/internal/util.js#L23-L29 Fixing #10174 by updating mongodb seems more important than reverting the update to silence these harmless deprecation warnings (which, it bears repeating, were introduced in a patch update). Thanks to @klaussner for raising this concern!
12 lines
416 B
JavaScript
12 lines
416 B
JavaScript
const oldNoDeprecationValue = process.noDeprecation;
|
|
try {
|
|
// Silence deprecation warnings introduced in a patch update to mongodb:
|
|
// https://github.com/meteor/meteor/pull/9942#discussion_r218564879
|
|
process.noDeprecation = true;
|
|
NpmModuleMongodb = Npm.require('mongodb');
|
|
} finally {
|
|
process.noDeprecation = oldNoDeprecationValue;
|
|
}
|
|
|
|
NpmModuleMongodbVersion = Npm.require('mongodb/package.json').version;
|