I have the following schema. I am using node.js with mongodb
attributes: {
type: { type: \'string\' },
title: { type:\'string\' },
description:
You are trying to insert an array
as an element into your array. You may want to look at $pushAll
as a short term solution. This operator is deprecated however see here.
Alternatively you can simply iterate over your array, and each iteration push an element from your array into attachments
(this is the recommended approach by Mongo devs).