我需要在mongodb中的列表中的列表中插入字典,
我有这个数据库:
{library_id:1, library_name:rj, library_books:[{book_name:r&d, page_num:312, book_tags:[]}, {book_name:java, page_num:122, book_tags:[]}]}
我想根据合适的book_name插入book_tags
所以会是这样(对于book_name r&d)-
{library_id:1, library_name:rj, library_books:[{book_name:r&d, page_num:312, book_tags:[{tag_name:study, tag_description:self learning}]},{book_name:java, page_num:122, book_tags:[]}]}
我该怎么做? 谢谢!