Partial index creation with array in the expression is not working

Partial index when proving an array in expression is not working, am I missing something?

Mongo version: 6.0.0

db.collection.createIndex(
{ user: 1, check: 1 },
{ partialFilterExpression: { check: { $in: [‘admin’, ‘staff’] } } }
)

Hi @Aayush_Lakhani welcome to the community!

Can you share the query that is supposed to use the index? When working with this type of index, your query must have the same filter expression used to create the index to use it.

1 Like