Hi @DrTrabant, welcome to the community
Let’s unpack this.
Why is the paired items now in it? I’ve read the docs but don’t need it at all.
You can simply ignore these if you don’t need them.
I cant create a key value pair in this screenshot. If i try to insert just the values i get this error, if i try to insert it by key values as “expression” like: {{ gpcode: $json[“data”][“id”] }}
When using an expression in the “Fields” field of the MongoDB node, you’d need to make sure to provide a string. n8n will try to split this string on each comma, but this would fail for a numeric value like in your screenshot. The values provided here would specify the keys. n8n would then read the corresponding values from the incoming items and insert the resulting pairs as a new document in MongoDB.
So in other words, you’d need to bring your data into a “table-like” structure first before inserting them into MongoDB.
Here’s a quick example workflow inserting dummy data into MongoDB:
When looking at the example data you can see how I am passing on a JSON structure consisting of key/value pairs here, then in the “Fields” field I specify the names of the fields I want to insert into MongoDB:
This results in MongoDB documents like this:
So you’d need to bring your existing data into a similar structure, where each field you’re trying to add to your MongoDB collection exists on the incoming n8n items. If you need any assistance with this it’d be great if you could share the JSON data returned by your HTTP Request node so I can have a go at writing a short transformation snippet here (or recommend other ways to achieve this).