Mongodb index creation problem

if the collection test has the following document format

{
        "_id" : ObjectId("123456"),
        "name" : "test",
        "body" : [
                {
                        "hash" : "123123123"
                }
        ]
}

how to create an index for the key hash at this time. The value of body is an array. So I"m a little confused

.
Jul.07,2021

db.test.createIndex({"body.hash": 1})
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3a53f-40790.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3a53f-40790.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?