Member since
08-26-2020
5
Posts
0
Kudos Received
1
Solution
My Accepted Solutions
Title | Views | Posted |
---|---|---|
6432 | 08-29-2020 10:22 AM |
09-06-2020
06:44 AM
I am using GetHTTP processor to get a html from the given url. I want to grab the innerHTML text of a particular class selector. I tried to achieve the same by using GetHTMLElement but this GetHTMLElement processor is giving N number of flowFiles. The selector what I am passing has only once in a html but I am getting n number of times. does anyone know why? In the below screenshot first 10 entries are unique and remaining redundant. My requirement is to fetch a web page html and extract required innerHTML text by passing selector or XPath and then make a JSON and insert into mongoDB. I am facing issue while extracting innerHTML text by passing css selector. Please help me to solve this. How can i achieve this. I have searched a lot but didn’t get any proper solution. I would really appreciate if you help me.
... View more
Labels:
08-29-2020
10:22 AM
I have achieved this by using AVRO schema. In place of putMongo Now I am using putMongoRecord and convertRecord for converting schema. Here is an example for AVRO schema : {
"type": "record",
"namespace": "nifi",
"name": "fredSchema",
"fields": [
{
"name": "createdAt",
"type": {
"type": "int",
"logicalType": "date"
}
}
]
} Use the above AVRO schema, and remember the date what you are going to sen should be yyyy-MM-dd format. Thanks.
... View more
08-26-2020
04:07 AM
I am trying to insert a flow file into MongoDb which has a createdAt date key record as an attribute. When I inserted that flow file into MongoDb using PutMongo processor, it saves the "createdAt" attribute as a string. I want this to be saved as an ISO date object in mongoDB. When I inserted flow file by sending "2020-08-26T04:00:00.000Z" PutMongo Processor inserts as a string. When I sent like this “ISODate("2020-08-26T04:00:00.000Z”)” it also inserts same string as it is into mongo. When I tried like this ISODate("2020-08-26T04:00:00.000Z”) without double quotation it throws error invalid object. I need output as : { “createdAt”: ISODate("2020-08-26T04:00:00.000Z”) } Kindly help if there is any way to do so.
... View more
Labels: