[CSHARP-4062] Projection of constant with no known serializer is not supported Created: 16/Feb/22  Updated: 28/Oct/23  Resolved: 30/Mar/22

Status: Closed
Project: C# Driver
Component/s: LINQ3, Serialization
Affects Version/s: None
Fix Version/s: 2.15.1

Type: Bug Priority: Unknown
Reporter: Boris Dogadov Assignee: Robert Stam
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Epic Link: CSHARP-3615
Backwards Compatibility: Fully Compatible

 Description   

Summary

The following expression (expressions not referencing the input object) in LINQ3

var query = coll.Aggregate().Project(x => new { IsTrue = true });

throws

Unhandled exception. System.InvalidOperationException: Cannot find serializer for { IsTrue = True }



 Comments   
Comment by Githook User [ 04/May/22 ]

Author:

{'name': 'rstam', 'email': 'robert@robertstam.org', 'username': 'rstam'}

Message: CSHARP-4062: Projection of constant with no known serializer is not supported.
Branch: v2.15.x
https://github.com/mongodb/mongo-csharp-driver/commit/cb379d58b7e42c932dccf262e6f19b69a40b6666

Comment by Githook User [ 30/Mar/22 ]

Author:

{'name': 'rstam', 'email': 'robert@robertstam.org', 'username': 'rstam'}

Message: CSHARP-4062: Projection of constant with no known serializer is not supported.
Branch: master
https://github.com/mongodb/mongo-csharp-driver/commit/df78ce29e112c618b53dad8a488b83239ec7f35e

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