У меня есть 2 сборника книг и курсов. Мне нужно получить данные о курсах с коллекцией книг, когда мы получим данные о книгах, которые представлены в форме массива в коллекции книг. 1-я коллекция Книги:
[
{
"_id": {
"$oid": "5ed0f3efcb4b0000c500462b"
},
"name": "book",
"guard_name": "web",
"updated_at": {
"$date": "2020-05-29T11:37:19.502Z"
},
"created_at": {
"$date": "2020-05-29T11:37:19.502Z"
},
"chapter_ids": [
"5ed0f3efcb4b0000c5004622",
"5ed0f3efcb4b0000c5004623",
"5ed0f3efcb4b0000c5004624",
"5ed0f3efcb4b0000c5004625",
"5ed0f3efcb4b0000c5004626",
"5ed0f3efcb4b0000c5004627",
"5ed0f3efcb4b0000c5004628",
"5ed0f3efcb4b0000c5004629",
"5ed0f3efcb4b0000c500462a"
],
"user_ids": [
"5ed0f5bf815f000004006fa5"
]
}
]
2-я коллекция Главы:
[
{
"_id": {
"$oid": "5ed0f3efcb4b0000c5004622"
},
"name": "users manage",
"guard_name": "web",
"updated_at": {
"$date": "2020-05-29T11:37:19.488Z"
},
"created_at": {
"$date": "2020-05-29T11:37:19.488Z"
},
"book_ids": [
"5ed0f3efcb4b0000c500462b"
]
},
{
"_id": {
"$oid": "5ed0f3efcb4b0000c5004623"
},
"name": "role list",
"guard_name": "web",
"updated_at": {
"$date": "2020-05-29T11:37:19.491Z"
},
"created_at": {
"$date": "2020-05-29T11:37:19.491Z"
},
"book_ids": [
"5ed0f3efcb4b0000c500462b"
]
},
{
"_id": {
"$oid": "5ed0f3efcb4b0000c5004624"
},
"name": "role create",
"guard_name": "web",
"updated_at": {
"$date": "2020-05-29T11:37:19.492Z"
},
"created_at": {
"$date": "2020-05-29T11:37:19.492Z"
},
"book_ids": [
"5ed0f3efcb4b0000c500462b"
]
},
{
"_id": {
"$oid": "5ed0f3efcb4b0000c5004625"
},
"name": "role edit",
"guard_name": "web",
"updated_at": {
"$date": "2020-05-29T11:37:19.493Z"
},
"created_at": {
"$date": "2020-05-29T11:37:19.493Z"
},
"book_ids": [
"5ed0f3efcb4b0000c500462b"
]
},
{
"_id": {
"$oid": "5ed0f3efcb4b0000c5004626"
},
"name": "role delete",
"guard_name": "web",
"updated_at": {
"$date": "2020-05-29T11:37:19.494Z"
},
"created_at": {
"$date": "2020-05-29T11:37:19.494Z"
},
"book_ids": [
"5ed0f3efcb4b0000c500462b"
]
},
{
"_id": {
"$oid": "5ed0f3efcb4b0000c5004627"
},
"name": "item list",
"guard_name": "web",
"updated_at": {
"$date": "2020-05-29T11:37:19.495Z"
},
"created_at": {
"$date": "2020-05-29T11:37:19.495Z"
},
"book_ids": [
"5ed0f3efcb4b0000c500462b"
]
},
{
"_id": {
"$oid": "5ed0f3efcb4b0000c5004628"
},
"name": "item create",
"guard_name": "web",
"updated_at": {
"$date": "2020-05-29T11:37:19.497Z"
},
"created_at": {
"$date": "2020-05-29T11:37:19.497Z"
},
"book_ids": [
"5ed0f3efcb4b0000c500462b"
]
},
{
"_id": {
"$oid": "5ed0f3efcb4b0000c5004629"
},
"name": "item edit",
"guard_name": "web",
"updated_at": {
"$date": "2020-05-29T11:37:19.498Z"
},
"created_at": {
"$date": "2020-05-29T11:37:19.498Z"
},
"book_ids": [
"5ed0f3efcb4b0000c500462b"
]
},
{
"_id": {
"$oid": "5ed0f3efcb4b0000c500462a"
},
"name": "item delete",
"guard_name": "web",
"updated_at": {
"$date": "2020-05-29T11:37:19.499Z"
},
"created_at": {
"$date": "2020-05-29T11:37:19.499Z"
},
"book_ids": [
"5ed0f3efcb4b0000c500462b"
]
}
]
Мне нужны данные о курсах в коллекции книг, где массив коллекции курсов присутствует в коллекции книг. Пожалуйста, помогите мне получить это.