One Star

Extract MongoDB JSON file into an output file

Hello, I'm having trouble trying to extract out the JSON file given to me using "Talend for Big Data".
I tried using the Metadata to auto-extract the fields out, but it seems to be missing some columns. I went to open the file and noticed that because some columns have NULL values, their columns are never mentioned and thus the attached picture below.
Eg. The first line of data starts with the column "id", but the next line has data that starts with the column "projectName".
I'm guessing the programme could only extract the schema based on the first line of data. 
Is anyone able to solve this problem?

Additional info:
JSON file extracted/exported out from MongoDB
I'm not allowed to show the data as it may contain sensitive information.
3 REPLIES
Moderator

Re: Extract MongoDB JSON file into an output file

Hi,
What does your json file look like? Did you read it by json path or Xpath in file json metadata? 
Would you mind showing some sample of your json file on forum?
Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
One Star

Re: Extract MongoDB JSON file into an output file

Hi,
What does your json file look like? Did you read it by json path or Xpath in file json metadata? 
Would you mind showing some sample of your json file on forum?
Best regards
Sabrina

I can't show the entire data as it contains sensitive information, but I can show how each data starts:
When I pass in the data of this JSON file, it can only read by JSON path and not Xpath. 
Moderator

Re: Extract MongoDB JSON file into an output file

Hi,
Thanks for posting the data of this json file here.
Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.