You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
great idea in including indexing options at field level.
Although it will serve every day needs, I wonder how this could be extended to manage compound indexes and Index intersection for more advanced apps that aim to use covered queries for better performance.
I guess it should be at collection level?
The text was updated successfully, but these errors were encountered:
+1, we also have a need to define compound unique key. For example, fields 'foo' and 'bar' are both non-optional and we want the combination to be unique.
or perhaps specify the name of the index on each field and then define the index at the collection level, including the same name. E.g.
Schema=newSimpleSchema{compoundField1: {type: Number,name: 'Compound Field 1',index: 'compound_index_1'},compoundField2: {type: Number,name: 'Compound Field 2',index: ['compound_index_1','index2']//<-- note MULTIPLE indexes on the same field}...}Collection=newMongo.Collection('collection');Collection.attachSchema(Schema);Collection.attachIndex('compound_index_1',{unique: true,background: false,//sparse: false,//partialFilterExpression: xxx//expireAfterSeconds: xxx//storageEngine: xxx//and so on//basically all the mongo properties could be passed through to createIndex});Collection.attachIndex('index2');//just use the deafults. e.g. simple, ascending index
great idea in including indexing options at field level.
Although it will serve every day needs, I wonder how this could be extended to manage compound indexes and Index intersection for more advanced apps that aim to use covered queries for better performance.
I guess it should be at collection level?
The text was updated successfully, but these errors were encountered: