|
|
@@ -43,7 +43,7 @@ const pageSchema = new mongoose.Schema({
|
|
|
},
|
|
|
isEmpty: { type: Boolean, default: false },
|
|
|
path: {
|
|
|
- type: String, required: true,
|
|
|
+ type: String, required: true, index: true,
|
|
|
},
|
|
|
revision: { type: ObjectId, ref: 'Revision' },
|
|
|
redirectTo: { type: String, index: true },
|
|
|
@@ -72,9 +72,6 @@ const pageSchema = new mongoose.Schema({
|
|
|
pageSchema.plugin(mongoosePaginate);
|
|
|
pageSchema.plugin(uniqueValidator);
|
|
|
|
|
|
-// TODO: test this after modifying Page.create
|
|
|
-// ensure v4 compatibility using partial index
|
|
|
-pageSchema.index({ path: 1 }, { unique: true, partialFilterExpression: { parent: null } });
|
|
|
|
|
|
/**
|
|
|
* return an array of ancestors paths that is extracted from specified pagePath
|