Uploaded image for project: 'Java Driver'
  1. Java Driver
  2. JAVA-3228

Watch with project pipeline didn't work correctly.

    • Type: Icon: Bug Bug
    • Resolution: Works as Designed
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Change Streams
    • Labels:
      None

      I am using mongo java drivers as below:

       

      <dependency>
            <groupId>org.mongodb</groupId>
            <artifactId>mongo-java-driver</artifactId>
             <version>3.10.1</version>
          </dependency>
          <dependency>
            <groupId>org.mongodb</groupId>
            <artifactId>mongodb-driver-reactivestreams</artifactId>
            <version>1.11.0</version>
          </dependency>
       
      

      When I define a simple pipeline as:

      List<Bson> pipeline = Arrays.asList(
                      Aggregates.project(Projections.fields(
                              Projections.computed("id", "$fullDocument._id")
                      ))
              );
      

      After my doing some CRUD operations, I always get these 'null' output:

      ChangeStreamDocument{resumeToken={"_data": "825C8B65510000000129295A1004E2034BD33C7D40DE92CB94E139C92CB146645F696400645C8B65511B2DF1941FD846250004"}, namespace=null, fullDocument=null, documentKey=null, clusterTime=null, operationType=null, updateDescription=null}
      ChangeStreamDocument{resumeToken={"_data": "825C8B65510000000229295A1004E2034BD33C7D40DE92CB94E139C92CB146645F696400645C8B65511B2DF1941FD846250004"}, namespace=null, fullDocument=null, documentKey=null, clusterTime=null, operationType=null, updateDescription=null}
      ChangeStreamDocument{resumeToken={"_data": "825C8B65560000000129295A1004E2034BD33C7D40DE92CB94E139C92CB146645F696400645C8B65511B2DF1941FD846250004"}, namespace=null, fullDocument=null, documentKey=null, clusterTime=null, operationType=null, updateDescription=null}
      ChangeStreamDocument{resumeToken={"_data": "825C8B65560000000229295A1004E2034BD33C7D40DE92CB94E139C92CB146645F696400645C8B65511B2DF1941FD846250004"}, namespace=null, fullDocument=null, documentKey=null, clusterTime=null, operationType=null, updateDescription=null}
      

      Did not it should be like :

      {
          "id": xxxxxxxxxx
      }
      

      Please correct me.

       

       

            Assignee:
            ross@mongodb.com Ross Lawley
            Reporter:
            jiehan2019 Han
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: