I am curious what the best approach might be to create a button in meteor to duplicate an array object. As an example if I had:
"TasksWithData": [
{
"inspectionDetails": [
{
"name": "somename",
"inspector": "Ss6TjGGzqWJRZYStx",
"inspectorName": "name of inspector",
"projectType": "inspection",
"startDate": "2017-01-12T05:00:00.000Z",
"desc": "a description",
"activeTask": true
}
],
"TaskItem": [
{
"DataFacilitySection": "dsfgsdfgds",
"DataItemDescription": "item 2",
"DataItemSection": "dfgdfgdf",
"DataItemCode": "dfgdfgdf",
"DataItemPass": null
}
],
}
],
If I wanted to duplicate the entire TasksWithData object shown above and add it as a new object in the same array (which is a sub-document and does not have an _id) with a button…how would I do this?