Hello @Aamod_Pisat, as I had mentioned earlier, you cannot use that query to count the number of fields in the test object (or sub-document ). The query you had posted doesn’t the number of fields - it only finds documents where the "test.a" value is greater than 1.
Yes, the index defined on the "test.a" will be used in the query - as you had mentioned there is an IXSCAN from the query plan.
Please note that the two queries have different purposes.