I am trying to insert a json array into mongodb using Putmongo processor in Apache nifi. But I'm getting an error:
error: current bson type is an array and not a document
Here is my json:
[{"Name":"computer","TotalRevenue":15000},
{"Name":"music","TotalRevenue":1500},
{"Name":"space","TotalRevenue":5000}][{"Name":"a rehman","company":"music","revenue":500},
{"Name":"bill gates","company":"computer","revenue":6000},
{"Name":"elon must","company":"space","revenue":5000},
{"Name":"john lenin","company":"music","revenue":1000},
{"Name":"steve jobs","company":"computer","revenue":9000}]
Also, I'm attaching the Putmongo configuration
Here is my Full Apache Flow :
GetFile CSV -> ConvertRecord to Json -> QueryRecord -> MergeContent -> PutMongo