[SERVER-36134] Server 4.0 throws Invalid field name: "clusterTime" in change stream Created: 14/Jul/18  Updated: 14/Aug/18  Resolved: 17/Jul/18

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: 4.0.0
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Ryan Joseph Assignee: Nick Brewer
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Operating System: ALL
Steps To Reproduce:

using change stream, do:

var filter = "{ $and: [

{ operationType: 'update' }

, " +
"{ 'fullDocument._id' : '" + id+ "'}" +
"{ 'updateDescription.updatedFields." + aField+ "':

{ $exists: true }

} ] }";

var pipeline = new EmptyPipelineDefinition<ChangeStreamDocument<BsonDocument>>().Match(filter);

var changeStream = collectionDoc.Watch(pipeline, options).ToEnumerable().GetEnumerator();

while (changeStream.MoveNext() && !cancellationToken.IsCancellationRequested)

{      var change = changeStream.Current;      var updatedFields = change.UpdateDescription.UpdatedFields;      var changeUserID = BsonSerializer.Deserialize<User>(change.FullDocument).ID; }
Participants:

 Description   

When running local server MongoDB 4.0, Change stream's MoveNext()
throws System.FormatException: Invalid field name: "clusterTime".  Downloaded previous version 3.6.6 and it works fine so it seems like this is a 4.0 issue only.

This is being done using C# driver: 2.5.1



 Comments   
Comment by Nick Brewer [ 17/Jul/18 ]

ryan.vi.joseph@gmail.com Glad to hear it's working.

Nick

Comment by Ryan Joseph [ 17/Jul/18 ]

@Nick

Updating to driver 2.7 did the trick. Sorry for the inconvenience. We can close this ticket.

-Ryan

Comment by Ryan Joseph [ 16/Jul/18 ]

No problem, I'll give it a go this evening and report my findings.

Comment by Nick Brewer [ 16/Jul/18 ]

Hi ryan.vi.joseph@gmail.com

Per the C# driver documentation, MongoDB 4.0 is only supported by version 2.7 of the C# driver. Could you try upgrading to the latest version?

Thanks,
Nick

Generated at Thu Feb 08 04:42:08 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.