Assume the following data structure in MongoDB:
{ \"_id\" : \"Bob Blocker\", \"ratings\" : { \"771206753\" : 1 }, \"prevalence\" : 1 }
You can't index dynamic keys and indexing ratings would index the whole object as a blob so you don't want to do that either.
ratings
It may work better to rework your schema to:
{ "_id" : "Bob Blocker", "ratings" : [ {id: "771206753", value: 1} ], "prevalence" : 1 }
and then index 'ratings.id'.
'ratings.id'