Class MongoSourceBuilder.Batch<T>

    • Method Detail

      • mapFn

        @Nonnull
        public <T_NEW> MongoSourceBuilder.Batch<T_NEW> mapFn​(@Nonnull
                                                             FunctionEx<org.bson.Document,​T_NEW> mapFn)
        Type Parameters:
        T_NEW - type of the emitted object
        Parameters:
        mapFn - transforms the queried document to the desired output object
      • collection

        @Nonnull
        public MongoSourceBuilder.Batch<org.bson.Document> collection​(@Nullable
                                                                      java.lang.String collectionName)
        Specifies from which collection connector will read documents. If not invoked, then connector will look at all collections in given database.

        Example usage:

        
          MongoSourceBuilder.stream(name, supplier)
              .collection("myCollection");
         
        This function is an equivalent of calling collection(String, Class) with Document as the second argument.
        Parameters:
        collectionName - Name of the collection that will be queried.
        Returns:
        this builder
      • collection

        @Nonnull
        public <T_NEW> MongoSourceBuilder.Batch<T_NEW> collection​(java.lang.String collectionName,
                                                                  @Nonnull
                                                                  java.lang.Class<T_NEW> mongoType)
        Specifies from which collection connector will read documents. If not invoked, then connector will look at all collections in given database. All documents read will be automatically parsed to user-defined type using MongoDB's standard codec registry with pojo support added.

        Example usage:

        
          MongoSourceBuilder.stream(name, supplier)
              .collection("myCollection", MyDocumentPojo.class);
         
        This function is an equivalent for calling:
        
         import static com.hazelcast.jet.mongodb.impl.Mappers.toClass;
        
          MongoSourceBuilder.stream(name, supplier)
              .collection("myCollection")
              .mapFn(toClass(MyuDocumentPojo.class));
         
        Parameters:
        collectionName - Name of the collection that will be queried.
        mongoType - user defined type to which the document will be parsed.
        Returns:
        this builder