You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@beam.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2019/01/09 03:09:00 UTC

[jira] [Work logged] (BEAM-6241) MongoDbIO - Add Limit and Aggregates Support

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

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

                Author: ASF GitHub Bot
            Created on: 09/Jan/19 03:08
            Start Date: 09/Jan/19 03:08
    Worklog Time Spent: 10m 
      Work Description: sandboxws commented on pull request #7293: [BEAM-6241] Added limit and aggregates support to MongoDbIO
URL: https://github.com/apache/beam/pull/7293#discussion_r246247639
 
 

 ##########
 File path: sdks/java/io/mongodb/src/test/java/org/apache/beam/sdk/io/mongodb/MongoDbIOTest.java
 ##########
 @@ -266,6 +272,46 @@ public void testReadWithFilter() throws Exception {
     pipeline.run();
   }
 
+  @Test
+  public void testReadWithFilterAndLimit() throws Exception {
+
 
 Review comment:
   Will trim.
 
----------------------------------------------------------------
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:
users@infra.apache.org


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

    Worklog Id:     (was: 182821)
    Time Spent: 0.5h  (was: 20m)

> 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
>             Fix For: 2.10.0
>
>          Time Spent: 0.5h
>  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)