How to correctly design the library table of monogo

there is a function that often needs to query data according to the factory id. Which of the following designs is more reasonable?
or is the efficiency the same?

scenario 1:
{

     {
        "_id" : 1, 
        "product" : "1", 
        "price" : 5.5, 
        "quantity" : NumberInt(5), 
        "factory":"1"        
    },
    {
        "_id" : 2, 
        "product" : "2", 
        "price" : 5.5, 
        "quantity" : NumberInt(5), 
        "factory":"1"        
    },
    .....
    .....

}

scenario 2:
{

  "factory":"1",
  "list":[
     {
        "_id" : 1, 
        "product" : "1", 
        "price" : 5.5, 
        "quantity" : NumberInt(5),        
    },
    {
        "_id" : 2, 
        "product" : "2", 
        "price" : 5.5, 
        "quantity" : NumberInt(5),        
    },

    ....
    ....

  ]

}

Nov.19,2021

if you don't find out all the requirements at once, go to solution one, and the expansibility will be much better in the future.


if you modify it frequently, it is better to use 1, but the query uses 2


unless the list element is fixed and the content is relatively fixed. otherwise, you must choose 1 .
the second type of update/delete is not convenient, and the second is mongodb. The size limit of a document is only 16MB , when you have enough elements to exceed the limit. This kind of design and implementation of the business is a problem.
https://docs.mongodb.com/manu.

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-1b30417-2b478.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-1b30417-2b478.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?