[CSHARP-4329] $dateDiff failing in Mongo2Go V3.1.3 Created: 23/Sep/22  Updated: 27/Oct/23  Resolved: 10/Oct/22

Status: Closed
Project: C# Driver
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Unknown
Reporter: Isaac Williamson Assignee: Dmitry Lukyanov (Inactive)
Resolution: Gone away Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

Summary

$dateDiff is failing with "Invalid $project :: caused by :: Unknown expression $dateDiff."

Mongo Version

V2.13

Mongo2Go Version

V3.1.3

How to Reproduce

Code use below works in practise but not when testing.

{"duration", new BsonDocument 
                        {
                            { "$dateDiff", new BsonDocument 
                                {
                                    {"startDate", $"${nameof(State.Updated)}"},
                                    {"endDate", DateTime.Now},
                                    {"unit", "day"}
                                }
                            }
                        }
                    }



 Comments   
Comment by PM Bot [ 10/Oct/22 ]

There hasn't been any recent activity on this ticket, so we're resolving it. Thanks for reaching out! Please feel free to comment on this if you're able to provide more information.

Comment by Dmitry Lukyanov (Inactive) [ 23/Sep/22 ]

Hey isaac.williamson@paymentsense.com ,

Code use below works in practise but not when testing.

I'm not sure I understand this, can you elaborate?

Also Mongo2Go is not Mongo product, so if this problem happens only when you use Mongo2Go, then please create a report in their repository.

 

Generated at Wed Feb 07 21:47:54 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.