Take your time about giving sample documents.
if your question is about my quick note of storing profiles independently, it goes like this:
Click here to expand to see possible migration steps
make a migrator app, fetch a document, for each profile create a profile document in a new “profiles” collection, get its _id
and use it to replace profile array in main document, and after processing whole array patch the corresponding document (profiles field) in the database. this is the migration part.
drop current search index from main collection and create new search index on this new “profiles” collection.
rewrite your application to use “profiles” collection when you do search on profiles.
it involves at least 3 different operations, one involves changing main documents. so please be careful with the implementation since it can cause unwanted data loss