Thanks. That got me further. The final piece was I was using the wrong type. I was annotating a long instead of an int.
Thanks, Mike On Wed, Nov 1, 2017 at 3:35 PM, Matt Burgess <[email protected]> wrote: > Mike, > > Which Record Readers/Writers are you using? Do they have the option > for "Date Format", and if so, are they filled in? Date Format defaults > to empty, and the doc says it "[s]pecifies the format to use when > reading/writing Date fields. If not specified, Date fields will be > assumed to be number of milliseconds since epoch (Midnight, Jan 1, > 1970 GMT). If specified, the value must match the Java Simple Date > Format (for example, MM/dd/yyyy for a two-digit month, followed by a > two-digit day, followed by a four-digit year, all separated by '/' > characters, as in 01/01/2017)." > > I think at least for the Reader you specify in PutMongoRecord, you'll > need to configure it with a Date Format string. > > Regards, > Matt > > > On Wed, Nov 1, 2017 at 3:27 PM, Mike Thomsen <[email protected]> > wrote: > > According to the Avro documentation, this should define a date field: > > > > { > > "name": "DateTest", > > "type": "record", > > "fields": [ > > {"name": "date", "type": "long", "logicalType": "date"} > > ] > > } > > > > NiFi 1.5.0-SNAPSHOT treats that as a Long and writes it to Mongo that > way. > > What am I doing wrong here? > > > > Thanks, > > > > Mike >
