how to push new object in G1>P1C1> relies array…
db.test1.insertMany([
{
_id: 'G1',
name: 'My Group',
posts: [
{
_id: 'P1',
title: 'Post 1',
comments: [
{
_id: 'C1',
name: 'Comment 1',
replies: [
{
_id: 'R1',
content: 'Reply 1',
},
{
_id: 'R2',
content: 'Reply 2',
},
],
},
{
_id: 'C2',
name: 'Comment 2',
replies: [
{
_id: 'R3',
content: 'Reply 3',
},
{
_id: 'R4',
content: 'Reply 4',
},
],
},
],
},
],
},
{
_id: 'G2',
name: 'My Group',
posts: [
{
_id: 'P2',
title: 'Post 2',
comments: [
{
_id: 'C3',
name: 'Comment 3',
replies: [
{
_id: 'R5',
content: 'Reply 5',
},
{
_id: 'R6',
content: 'Reply 6',
},
],
},
{
_id: 'C4',
name: 'Comment 4',
replies: [
{
_id: 'R7',
content: 'Reply 7',
},
{
_id: 'R8',
content: 'Reply 8',
},
],
},
],
},
],
},
]);