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

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

                Author: ASF GitHub Bot
            Created on: 29/Jan/21 16:22
            Start Date: 29/Jan/21 16:22
    Worklog Time Spent: 10m 
      Work Description: iemejia commented on pull request #7293:
URL: https://github.com/apache/beam/pull/7293#issuecomment-769904071


   Sorry for late answer. I am also not that closely familiar with MongoDB APIs 
so you might be right about the overwrite.
   
   If I remember correctly I think the hardcoded cast to `FindQuery` was in 
place to support projection too, it is ugly indeed and hopefully we can correct 
it. Did you find a workaround or find some possible fix to propose?
   
   Don't hesitate to create a JIRA issue for this and tell me if you feel 
motivated to work on it. In case of more questions you can ask me here or on 
TheASF slack
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


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

    Worklog Id:     (was: 544338)
    Time Spent: 7h 50m  (was: 7h 40m)

> Add support for aggregates using withQueryFn to MongoDbIO
> ---------------------------------------------------------
>
>                 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: P2
>              Labels: easyfix
>             Fix For: 2.12.0
>
>          Time Spent: 7h 50m
>  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
(v8.3.4#803005)

Reply via email to