Added note to improve query performance with root ancestor targeting

This commit is contained in:
Stefan Zermatten
2021-04-29 11:34:58 +02:00
parent aef7dbcbb3
commit 217133137b

View File

@@ -4,6 +4,11 @@ const RefSchema = new SimpleSchema({
id: {
type: String,
regEx: SimpleSchema.RegEx.Id,
// TODO: Rather than indexing this field, index `ancestors.0.id` to only
// index the root of the ancestor heirarchy to significantly reduce
// index size and improve performance
// All queries on an ancestor document need to target `ancestors.0.id` first
// before targeting a younger ancestor
index: 1
},
collection: {