so i have a collection schema as follow
{
commonFilter: {
type: mongoose.Schema.Types.Mixed,
},
requestid: String,
userData: mongoose.Schema.Types.Mixed,
dateTime: {
type: Date,
default: Date.now,
}
}
and following is an example of commonfilter data,
commonFilter: {
field1: "as",
field2: 23,
field3: ["sa", "re"],
field4: [{
as: "as",
ASA: "as"
}]
}
I am using an aggregation query that searches based dateTime, requestid, and fields1-3 from common filter,
- is it possible to index the commonFilter which is a Mixed Type?
- Is there any best practice for indexing the mixed type?