Remove _ensureIndex log warning

This commit is contained in:
Jan Dvorak
2021-08-25 19:14:51 +02:00
parent 726f21283d
commit 58bd667bfa

View File

@@ -698,10 +698,10 @@ Object.assign(Mongo.Collection.prototype, {
var self = this;
if (!self._collection._ensureIndex || !self._collection.createIndex)
throw new Error("Can only call createIndex on server collections");
// TODO enable this message a release before we will remove this function
// import { Log } from 'meteor/logging';
// Log.debug(`_ensureIndex has been deprecated, please use the new 'createIndex' instead${options?.name ? `, index name: ${options.name}` : `, index: ${JSON.stringify(index)}`}`)
if (self._collection.createIndex) {
import { Log } from 'meteor/logging';
Log.debug(`_ensureIndex has been deprecated, please use the new 'createIndex' instead${options?.name ? `, index name: ${options.name}` : `, index: ${JSON.stringify(index)}`}`)
self._collection.createIndex(index, options);
} else {
self._collection._ensureIndex(index, options);