Class PutMongoRecord

java.lang.Object
org.apache.nifi.components.AbstractConfigurableComponent
org.apache.nifi.processor.AbstractSessionFactoryProcessor
org.apache.nifi.processor.AbstractProcessor
org.apache.nifi.processors.mongodb.AbstractMongoProcessor
org.apache.nifi.processors.mongodb.PutMongoRecord
All Implemented Interfaces:
org.apache.nifi.components.ConfigurableComponent, org.apache.nifi.processor.Processor

@Tags({"mongodb","insert","update","upsert","record","put"}) @InputRequirement(INPUT_REQUIRED) @CapabilityDescription("This processor is a record-aware processor for inserting/upserting data into MongoDB. It uses a configured record reader and schema to read an incoming record set from the body of a flowfile and then inserts/upserts batches of those records into a configured MongoDB collection. This processor does not support deletes. The number of documents to insert/upsert at a time is controlled by the \"Batch Size\" configuration property. This value should be set to a reasonable size to ensure that MongoDB is not overloaded with too many operations at once.") @ReadsAttribute(attribute="mongodb.update.mode", description="Configurable parameter for controlling update mode on a per-flowfile basis. Acceptable values are \'one\' and \'many\' and controls whether a single incoming record should update a single or multiple Mongo documents.") public class PutMongoRecord extends AbstractMongoProcessor
  • Field Details

    • REL_SUCCESS

      static final org.apache.nifi.processor.Relationship REL_SUCCESS
    • REL_FAILURE

      static final org.apache.nifi.processor.Relationship REL_FAILURE
    • RECORD_READER_FACTORY

      static final org.apache.nifi.components.PropertyDescriptor RECORD_READER_FACTORY
    • INSERT_COUNT

      static final org.apache.nifi.components.PropertyDescriptor INSERT_COUNT
    • ORDERED

      static final org.apache.nifi.components.PropertyDescriptor ORDERED
    • BYPASS_VALIDATION

      static final org.apache.nifi.components.PropertyDescriptor BYPASS_VALIDATION
    • UPDATE_KEY_FIELDS

      static final org.apache.nifi.components.PropertyDescriptor UPDATE_KEY_FIELDS
    • UPDATE_MODE

      static final org.apache.nifi.components.PropertyDescriptor UPDATE_MODE
    • RELATIONSHIPS

      private static final Set<org.apache.nifi.processor.Relationship> RELATIONSHIPS
    • PROPERTY_DESCRIPTORS

      private static final List<org.apache.nifi.components.PropertyDescriptor> PROPERTY_DESCRIPTORS
  • Constructor Details

    • PutMongoRecord

      public PutMongoRecord()
  • Method Details

    • getRelationships

      public Set<org.apache.nifi.processor.Relationship> getRelationships()
      Specified by:
      getRelationships in interface org.apache.nifi.processor.Processor
      Overrides:
      getRelationships in class org.apache.nifi.processor.AbstractSessionFactoryProcessor
    • getSupportedPropertyDescriptors

      public List<org.apache.nifi.components.PropertyDescriptor> getSupportedPropertyDescriptors()
      Overrides:
      getSupportedPropertyDescriptors in class org.apache.nifi.components.AbstractConfigurableComponent
    • onTrigger

      public void onTrigger(org.apache.nifi.processor.ProcessContext context, org.apache.nifi.processor.ProcessSession session) throws org.apache.nifi.processor.exception.ProcessException
      Specified by:
      onTrigger in class org.apache.nifi.processor.AbstractProcessor
      Throws:
      org.apache.nifi.processor.exception.ProcessException
    • convertArrays

      private org.bson.Document convertArrays(org.bson.Document doc)
    • convertArrays

      private List<Object> convertArrays(Object[] input)
    • buildFilters

      private org.bson.conversions.Bson[] buildFilters(Map<String,List<String>> updateKeyFieldPathToFieldChain, org.bson.Document readyToUpsert)