Mike, The query is failing JSON validation because the value of the “$gte” key is not valid JSON. You should be able to use a combination of NiFi Expression Language [1] and the UpdateAttribute processor [2] to populate the expected date value in your query. Once NIFI-4082 [3] is implemented, you won’t need the UpdateAttribute processor anymore.
[1] https://nifi.apache.org/docs/nifi-docs/html/expression-language-guide.html [2] https://stackoverflow.com/a/44585760/70465 [3] https://issues.apache.org/jira/browse/NIFI-4082 <https://issues.apache.org/jira/browse/NIFI-4082> Andy LoPresto [email protected] [email protected] PGP Fingerprint: 70EC B3E5 98A6 5A3F D3C4 BACE 3C6E F65B 2F7D EF69 > On Jun 23, 2017, at 9:06 AM, Mike Thomsen <[email protected]> wrote: > > I am trying to write a query for GetMongo that gives me documents added in > the last five minutes. It looks like this: > > { > "ts": { > "$gte": new Date(ISODate().getTime() - (1000 * 60 * 5)) > } > } > > The processor goes to an invalid state because it says "query validated > against [that query] is invalid because org.bosn.json.JsonParseException." > Does anyone know how to convert that query from the Mongo command > shell-acceptable syntax into one NiFi can accept? > > Thanks, > > Mike
signature.asc
Description: Message signed with OpenPGP using GPGMail
