org.apache.storm.mongodb.common.mapper

## Class SimpleMongoLookupMapper

- java.lang.Object
- - org.apache.storm.mongodb.common.mapper.SimpleMongoLookupMapper

- All Implemented Interfaces:
    Serializable, MongoLookupMapper

      public class SimpleMongoLookupMapper
      extends Object
      implements MongoLookupMapper

  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `SimpleMongoLookupMapper(String... fields)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `declareOutputFields(OutputFieldsDeclarer declarer)` declare what are the fields that this code will output.
    `List<Values>` | `toTuple(ITuple input, org.bson.Document doc)` Converts a Mongo document to a list of storm values that can be emitted.
    `SimpleMongoLookupMapper` | `withFields(String... fields)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### SimpleMongoLookupMapper

          public SimpleMongoLookupMapper(String... fields)

  - ### Method Detail

    - #### toTuple

          public List<Values> toTuple(ITuple input,
                                      org.bson.Document doc)

      Description copied from interface: `MongoLookupMapper`

      Converts a Mongo document to a list of storm values that can be emitted. This is done to allow a single storm input tuple and a single Mongo document to result in multiple output values.

      Specified by:
        `toTuple` in interface `MongoLookupMapper`
      Parameters:
        `input` - the input tuple.
        `doc` - the mongo document
      Returns:
        a List of storm values that can be emitted. Each item in list is emitted as an output tuple.

    - #### declareOutputFields

          public void declareOutputFields(OutputFieldsDeclarer declarer)

      Description copied from interface: `MongoLookupMapper`

      declare what are the fields that this code will output.

      Specified by:
        `declareOutputFields` in interface `MongoLookupMapper`
      Parameters:
        `declarer` - OutputFieldsDeclarer

    - #### withFields

          public SimpleMongoLookupMapper withFields(String... fields)

Copyright © 2019 The Apache Software Foundation. All rights reserved.