Class MongoDBFindProducer

  • All Implemented Interfaces:
    AdaptrisComponent, AdaptrisMessageProducer, AdaptrisMessageSender, AdaptrisMessageWorker, ComponentLifecycle, ComponentLifecycleExtension, MessageEventGenerator

    @ComponentProfile(summary="Executes find MongoDB queries, results returned as JSON Array.",
                      tag="producer,mongodb",
                      recommended=MongoDBConnection.class)
    public class MongoDBFindProducer
    extends MongoDBRetrieveProducer
    Producer that executes find MongoDB queries, results returned as JSON Array.

    Example Filter:
    Filters results stars greater than or equal to 2 and less that 5 with category of Bakery.

    Data:

         
         [
           { "name" : "Café Con Leche", "stars" : 3, "categories" : ["Bakery", "Coffee", "Pastries"] },
           { "name" : "Fred's", "stars" : 1, "categories" : ["Bakery", "Coffee", "Pastries"] }
         ]
         
       

    Query:

         
         { "stars" : { "$gte" : 2, "$lt" : 5 }, "categories" : "Bakery" }
         
       

    Result:

         
         [ { "name" : "Café Con Leche", "stars" : 3, "categories" : ["Bakery", "Coffee", "Pastries"] } ]
         
       

    In the adapter configuration file this class is aliased as mongodb-find-producer which is the preferred alternative to the fully qualified classname when building your configuration.