[ 
https://issues.apache.org/jira/browse/BEAM-6241?focusedWorklogId=193626&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-193626
 ]

ASF GitHub Bot logged work on BEAM-6241:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 02/Feb/19 06:33
            Start Date: 02/Feb/19 06:33
    Worklog Time Spent: 10m 
      Work Description: sandboxws commented on issue #7293: [BEAM-6241] Added 
limit and aggregates support to MongoDbIO
URL: https://github.com/apache/beam/pull/7293#issuecomment-459940313
 
 
   @iemejia I think I nailed it.  https://github.com/sandboxws/beam/pull/1
   
   I've added the following:
   
   ```
   - Support to use splitVector with AggregationQuery, i.e. MongoDB Aggregations
   - Support to use $bucketAuto in case splitVector is not supported (Fixes 
https://issues.apache.org/jira/browse/BEAM-4567)
   ```
   
   You can read more about `$bucketAuto` here:
   https://docs.mongodb.com/manual/reference/operator/aggregation/bucketAuto/
   
   If we agree on this approach, I can cherry pick you commit, then apply the 
changes from above tmp PR.
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
-------------------

    Worklog Id:     (was: 193626)
    Time Spent: 6h  (was: 5h 50m)

> MongoDbIO - Add Limit and Aggregates Support
> --------------------------------------------
>
>                 Key: BEAM-6241
>                 URL: https://issues.apache.org/jira/browse/BEAM-6241
>             Project: Beam
>          Issue Type: Improvement
>          Components: io-java-mongodb
>    Affects Versions: 2.9.0
>            Reporter: Ahmed El.Hussaini
>            Assignee: Ahmed El.Hussaini
>            Priority: Major
>              Labels: easyfix
>          Time Spent: 6h
>  Remaining Estimate: 0h
>
> h2. Adds Support to Limit Results
>  
> {code:java}
> MongoDbIO.read()
> .withUri("mongodb://localhost:" + port)
> .withDatabase(DATABASE)
> .withCollection(COLLECTION)
> .withFilter("{\"scientist\":\"Einstein\"}")
> .withLimit(5));{code}
> h2. Adds Support to Use Aggregates
>  
> {code:java}
> List<BsonDocument> aggregates = new ArrayList<BsonDocument>();
>   aggregates.add(
>     new BsonDocument(
>       "$match",
>       new BsonDocument("country", new BsonDocument("$eq", new 
> BsonString("England")))));
> PCollection<Document> output =
>   pipeline.apply(
>     MongoDbIO.read()
>       .withUri("mongodb://localhost:" + port)
>       .withDatabase(DATABASE)
>       .withCollection(COLLECTION)
>       .withAggregate(aggregates));
> {code}
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to