mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
@@ -1,3 +1,19 @@
|
||||
## v.NEXT, 2022-04-XX
|
||||
|
||||
#### Highlights
|
||||
|
||||
#### Breaking Changes
|
||||
N/A
|
||||
#### Migration Steps
|
||||
|
||||
#### Meteor Version Release
|
||||
|
||||
* `mongo@1.15.0`
|
||||
- If an index with the same name, but different options exists Meteor will re-create it instead of crashing.
|
||||
- If there is an error Meteor will output a better message naming the collection and index where the error occured.
|
||||
|
||||
#### Independent Releases
|
||||
|
||||
## v2.7.1, 2022-03-31
|
||||
|
||||
#### Highlights
|
||||
|
||||
@@ -757,7 +757,19 @@ Object.assign(Mongo.Collection.prototype, {
|
||||
var self = this;
|
||||
if (!self._collection.createIndex)
|
||||
throw new Error('Can only call createIndex on server collections');
|
||||
self._collection.createIndex(index, options);
|
||||
try {
|
||||
self._collection.createIndex(index, options);
|
||||
} catch (e) {
|
||||
if (e.message.includes('An equivalent index already exists with the same name but different options.')) {
|
||||
import { Log } from 'meteor/logging';
|
||||
|
||||
Log.info(`Re-creating index ${index} for ${self._name} due to options mismatchs.`);
|
||||
self._collection._dropIndex(index);
|
||||
self._collection.createIndex(index, options);
|
||||
} else {
|
||||
throw new Meteor.Error(`An error occurred when creating an index for collection "${self._name}: ${e.message}`);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
_dropIndex(index) {
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
Package.describe({
|
||||
summary: "Adaptor for using MongoDB and Minimongo over DDP",
|
||||
version: '1.14.6'
|
||||
version: '1.15.0'
|
||||
});
|
||||
|
||||
Npm.depends({
|
||||
|
||||
Reference in New Issue
Block a user