Member since
05-31-2018
4
Posts
0
Kudos Received
0
Solutions
06-15-2019
08:21 AM
Hey guys! I'm having some difficulties with RunMongoAggregation. Could you please help me ? I've been using the other processor from Mongo, the GetMongo. This one works the way I need, but RunMongoAggregation is giving me some problems. This is the situation: I want to execute an aggregation in my mongo collection. First of all, I need to filter my entire collection to get the documents inside a time interval. For this, I'm using the "$date" parameter to transform my string to an ISODate type, but it look like $date is not working well (or I'm making some mistakes). This is what I'm trying to execute in RunMongoAggregation: { "$match": { "$and": [ { "processedAt": { "$gte": { "$date": "2019-06-14T11:13:27.519Z" } } }, { "eventType": "CustomerSiteAcceptedOffer" } ] } } ] My collection has the following structure: { "when" : ISODate("2019-06-16T00:00:00.000Z"), "processedAt" : ISODate("2019-06-14T14:48:53.287Z"), "eventType" : "CustomerSiteAcceptedOffer", "version" : 1, "context" : { "unstruct" : {}, "customer" : { "cpf" : "x", "cancelationReason" : "x", "customerCode" : "1517508329", "name" : "john" } } } And the weird point is: if I execute the following GetMongo processor query, I get the expected result: { "$and": [ { "processedAt": { "$gte": { "$date": "2019-06-14T11:13:27.519Z" } } }, { "eventType": "CustomerSiteAcceptedOffer" } ] } It looks like $date is not working, could you help me to figure out what's happening? Thanks! Best regards, Bob
... View more
- Tags:
- mongodb
06-04-2018
04:15 PM
Thanks, this solution is was I needed!
... View more
05-31-2018
07:21 PM
Hello! I have a flow that the first box is scheduled with cron. The cron is configured to execute every hour. At the start of the flow, I have to read a variable that I have set at the end of the last execution. How could I set a variable a variable at the end of the flow and how to read it at the start of the next execution? I have searched a lot and I saw something about context variable and counters. Maybe is it a way? Thanks! Best regards, Robert
... View more
- Tags:
- variable-registry
05-31-2018
07:13 PM
Hey guys, I have some questions about the usage of variables into nifi context. Scenario: I need to call an API, get some data (the body response is an array) and split this data into 8 different APIs. Each element from the array must go to different API (that is, each API needs to receive 12.5% requests). This process will happen every hour (this is scheduled with cron timer). The problem: I need to send this requests equally between the 8 API. But, if the array received from the first API is not an multiple from 8, will result in one or more APIs receiving less requests. So, in the next hour, i'll have to start the request by these API that received less request in the last hour. My idea is to persist the count (or which API received the last request) in the nifi context, so, in the next hour, I could start by theses API. How could I persist some variable in the end of the flow and in the start from another execution, retreive this variable? Thanks! Best regards, Bob
... View more
- Tags:
- variable-registry