<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Wed Feb 07 21:49:14 UTC 2024

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary append 'field=key&field=summary' to the URL of your request.
-->
<rss version="0.92" >
<channel>
    <title>MongoDB Jira</title>
    <link>https://jira.mongodb.org</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-us</language>    <build-info>
        <version>9.7.1</version>
        <build-number>970001</build-number>
        <build-date>13-04-2023</build-date>
    </build-info>


<item>
            <title>[CSHARP-4745] Unable to cast object of type &apos;MongoDB.Bson.BsonArray&apos; to type &apos;MongoDB.Bson.BsonDocument&apos;</title>
                <link>https://jira.mongodb.org/browse/CSHARP-4745</link>
                <project id="10041" key="CSHARP">C# Driver</project>
                    <description>&lt;p&gt;This code&lt;/p&gt;

&lt;p/&gt;
&lt;div id=&quot;syntaxplugin&quot; class=&quot;syntaxplugin&quot; style=&quot;border: 1px dashed #bbb; border-radius: 5px !important; overflow: auto; max-height: 30em;&quot;&gt;
&lt;table cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; border=&quot;0&quot; width=&quot;100%&quot; style=&quot;font-size: 1em; line-height: 1.4em !important; font-weight: normal; font-style: normal; color: black;&quot;&gt;
		&lt;tbody &gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;  margin-top: 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: #006699; font-weight: bold; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;new&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt; PipelineUpdateDefinition&amp;lt;MyDocument&amp;gt;(&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;color: #006699; font-weight: bold; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;new&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt; EmptyPipelineDefinition&amp;lt;MyDocument&amp;gt;()&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;        .Match(a =&amp;gt; a.MyObject == &lt;/span&gt;&lt;span style=&quot;color: #006699; font-weight: bold; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;null&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;))&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;            .Set(a =&amp;gt; a.MyObject, &lt;/span&gt;&lt;span style=&quot;color: #006699; font-weight: bold; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;new&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt; MyDocument.MyObject())&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;            .Render(&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;                BsonSerializer.SerializerRegistry.GetSerializer&amp;lt;MyDocument&amp;gt;(),&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;                BsonSerializer.SerializerRegistry&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   margin-bottom: 10px;  width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;            ).ToBsonDocument();&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
			&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p/&gt;

&lt;p&gt;Gives me this error:&lt;/p&gt;

&lt;p/&gt;
&lt;div id=&quot;syntaxplugin&quot; class=&quot;syntaxplugin&quot; style=&quot;border: 1px dashed #bbb; border-radius: 5px !important; overflow: auto; max-height: 30em;&quot;&gt;
&lt;table cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; border=&quot;0&quot; width=&quot;100%&quot; style=&quot;font-size: 1em; line-height: 1.4em !important; font-weight: normal; font-style: normal; color: black;&quot;&gt;
		&lt;tbody &gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;  margin-top: 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;System.InvalidCastException:&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   margin-bottom: 10px;  width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;Unable to cast object of type &apos;MongoDB.Bson.BsonArray&apos; to type &apos;MongoDB.Bson.BsonDocument&apos;.&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
			&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p/&gt;

&lt;p&gt;I think it is a bug.&lt;/p&gt;</description>
                <environment></environment>
        <key id="2410016">CSHARP-4745</key>
            <summary>Unable to cast object of type &apos;MongoDB.Bson.BsonArray&apos; to type &apos;MongoDB.Bson.BsonDocument&apos;</summary>
                <type id="1" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14703&amp;avatarType=issuetype">Bug</type>
                                            <priority id="4" iconUrl="https://jira.mongodb.org/images/icons/priorities/minor.svg">Minor - P4</priority>
                        <status id="6" iconUrl="https://jira.mongodb.org/images/icons/statuses/closed.png" description="The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.">Closed</status>
                    <statusCategory id="3" key="done" colorName="success"/>
                                    <resolution id="13203">Gone away</resolution>
                                        <assignee username="robert@mongodb.com">Robert Stam</assignee>
                                    <reporter username="rizwaanb10@gmail.com">A B</reporter>
                        <labels>
                    </labels>
                <created>Sat, 5 Aug 2023 17:08:15 +0000</created>
                <updated>Fri, 27 Oct 2023 22:19:31 +0000</updated>
                            <resolved>Fri, 27 Oct 2023 22:19:31 +0000</resolved>
                                                                                        <votes>0</votes>
                                    <watches>5</watches>
                                                                                                                <comments>
                            <comment id="5817565" author="rstam" created="Fri, 27 Oct 2023 22:19:31 +0000"  >&lt;p&gt;Closing this ticket because now that &lt;a href=&quot;https://jira.mongodb.org/browse/CSHARP-4747&quot; title=&quot;Add support for $set stage&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CSHARP-4747&quot;&gt;&lt;del&gt;CSHARP-4747&lt;/del&gt;&lt;/a&gt; has been addressed we have support for a $set stage.&lt;/p&gt;</comment>
                            <comment id="5624649" author="JIRAUSER1274316" created="Wed, 9 Aug 2023 22:07:57 +0000"  >&lt;p&gt;@&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=james.kovacs%40gmail.com&quot; class=&quot;user-hover&quot; rel=&quot;james.kovacs@gmail.com&quot;&gt;james.kovacs@gmail.com&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I can&apos;t even do &lt;em&gt;that&lt;/em&gt; &#9785;&#65039;&lt;/p&gt;

&lt;p&gt;See the screenshot over in:&lt;br/&gt;
&lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-79819&quot; class=&quot;external-link&quot; rel=&quot;nofollow&quot;&gt;https://jira.mongodb.org/browse/SERVER-79819&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="5624461" author="james.kovacs" created="Wed, 9 Aug 2023 20:39:56 +0000"  >&lt;p&gt;Hi, Riz,&lt;/p&gt;

&lt;p&gt;I reached out to our JIRA admins. Usernames come from the single sign-on providers and that username is the email address. Unfortunately username and email address are inextricably linked given how the SSO providers integrate with JIRA. My only suggestion is to use an alternate email address created for JIRA logins and notifications.&lt;/p&gt;

&lt;p&gt;Sincerely,&lt;br/&gt;
James&lt;/p&gt;</comment>
                            <comment id="5619666" author="JIRAUSER1274316" created="Tue, 8 Aug 2023 10:43:09 +0000"  >&lt;p&gt;I was trying to do this with aggregation pipelines:&lt;/p&gt;

&lt;p&gt;(my question on Stack Overflow) &lt;a href=&quot;https://stackoverflow.com/q/76813584&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://stackoverflow.com/q/76813584&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The plan was to have an aggregation pipeline that looks like this:&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;If X is NULL, set X to &lt;span class=&quot;error&quot;&gt;&amp;#91;NEW COMPLEX OBJECT&amp;#93;&lt;/span&gt;&lt;/li&gt;
	&lt;li&gt;Set X.A&lt;/li&gt;
	&lt;li&gt;Set X.B&lt;/li&gt;
	&lt;li&gt;...&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;Or:&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;If X is NULL, set X to &lt;span class=&quot;error&quot;&gt;&amp;#91;NEW COMPLEX OBJECT (with A, B ...)&amp;#93;&lt;/span&gt;&lt;/li&gt;
	&lt;li&gt;Else:
	&lt;ol&gt;
		&lt;li&gt;Set X.A&lt;/li&gt;
		&lt;li&gt;Set X.B&lt;/li&gt;
		&lt;li&gt;...&lt;/li&gt;
	&lt;/ol&gt;
	&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;&lt;b&gt;The update operation does auto create field X if NULL or missing, but,&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;this isn&apos;t useful if the CLASS based data model in code has additional properties&lt;/p&gt;

&lt;p&gt;which are evaluated upon construction (with the C# NEW keyword).&lt;/p&gt;

&lt;p&gt;Such as a date/time property with an auto property initializer.&lt;/p&gt;</comment>
                            <comment id="5618848" author="rstam" created="Mon, 7 Aug 2023 22:12:14 +0000"  >&lt;p&gt;I&apos;m making an educated guess at what you are trying to accomplish. I think the correct version of what you are trying to do is:&lt;/p&gt;
&lt;p/&gt;
&lt;div id=&quot;syntaxplugin&quot; class=&quot;syntaxplugin&quot; style=&quot;border: 1px dashed #bbb; border-radius: 5px !important; overflow: auto; max-height: 30em;&quot;&gt;
&lt;table cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; border=&quot;0&quot; width=&quot;100%&quot; style=&quot;font-size: 1em; line-height: 1.4em !important; font-weight: normal; font-style: normal; color: black;&quot;&gt;
		&lt;tbody &gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;  margin-top: 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;var filter = Builders&amp;lt;MyDocument&amp;gt;.Filter.Where(x =&amp;gt; x.MyObject == &lt;/span&gt;&lt;span style=&quot;color: #006699; font-weight: bold; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;null&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;);&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;var pipeline =&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;color: #006699; font-weight: bold; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;new&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt; EmptyPipelineDefinition&amp;lt;MyDocument&amp;gt;()&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;    .AppendStage&amp;lt;MyDocument, MyDocument, MyDocument&amp;gt;(&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;&quot;{ $set : { MyObject : { X : 1 } } }&quot;&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;);&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;var update = &lt;/span&gt;&lt;span style=&quot;color: #006699; font-weight: bold; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;new&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt; PipelineUpdateDefinition&amp;lt;MyDocument&amp;gt;(pipeline);&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&amp;nbsp;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   margin-bottom: 10px;  width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;var result = collection.UpdateOne(filter, update);&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
			&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p/&gt;
&lt;p&gt;Notice in particular that when using a pipeline to update documents the filter is NOT part of the pipeline, but rather is specified separately.&lt;/p&gt;

&lt;p&gt;Also, we don&apos;t yet have type safe builder support for the `$set` pipeline stage, so currently the only way to use a `$set` stage is to create the stage manually and use the general purpose `AppendStage` method.&lt;/p&gt;

&lt;p&gt;I have created &lt;a href=&quot;https://jira.mongodb.org/browse/CSHARP-4746&quot; title=&quot;PipelineUpdateDefinition cannot be combined with any other update definition&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CSHARP-4746&quot;&gt;&lt;del&gt;CSHARP-4746&lt;/del&gt;&lt;/a&gt; to track builder support for the `$set` stage.&lt;/p&gt;

&lt;p&gt;You don&apos;t actually have to use a pipeline for this simple update, where you are simply setting the value of a field. You could just use:&lt;/p&gt;

&lt;p/&gt;
&lt;div id=&quot;syntaxplugin&quot; class=&quot;syntaxplugin&quot; style=&quot;border: 1px dashed #bbb; border-radius: 5px !important; overflow: auto; max-height: 30em;&quot;&gt;
&lt;table cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; border=&quot;0&quot; width=&quot;100%&quot; style=&quot;font-size: 1em; line-height: 1.4em !important; font-weight: normal; font-style: normal; color: black;&quot;&gt;
		&lt;tbody &gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;  margin-top: 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;var collection = GetCollection(linqProvider);&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;var filter = Builders&amp;lt;MyDocument&amp;gt;.Filter.Where(x =&amp;gt; x.MyObject == &lt;/span&gt;&lt;span style=&quot;color: #006699; font-weight: bold; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;null&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;);&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;var update = Builders&amp;lt;MyDocument&amp;gt;.Update.Set(x =&amp;gt; x.MyObject, &lt;/span&gt;&lt;span style=&quot;color: #006699; font-weight: bold; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;new&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt; MyObject { X = &lt;/span&gt;&lt;span style=&quot;color: #009900; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt; });&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&amp;nbsp;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   margin-bottom: 10px;  width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;var result = collection.UpdateOne(filter, update);&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
			&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p/&gt;</comment>
                            <comment id="5618818" author="rstam" created="Mon, 7 Aug 2023 22:03:00 +0000"  >&lt;p&gt;Part of the issue here in &lt;a href=&quot;https://jira.mongodb.org/browse/CSHARP-4745&quot; title=&quot;Unable to cast object of type &amp;#39;MongoDB.Bson.BsonArray&amp;#39; to type &amp;#39;MongoDB.Bson.BsonDocument&amp;#39;&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CSHARP-4745&quot;&gt;&lt;del&gt;CSHARP-4745&lt;/del&gt;&lt;/a&gt; is that we don&apos;t yet have support for the $set pipeline stage.&lt;/p&gt;</comment>
                            <comment id="5618803" author="rstam" created="Mon, 7 Aug 2023 21:54:16 +0000"  >&lt;p&gt;Part of the issue here in &lt;a href=&quot;https://jira.mongodb.org/browse/CSHARP-4745&quot; title=&quot;Unable to cast object of type &amp;#39;MongoDB.Bson.BsonArray&amp;#39; to type &amp;#39;MongoDB.Bson.BsonDocument&amp;#39;&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CSHARP-4745&quot;&gt;&lt;del&gt;CSHARP-4745&lt;/del&gt;&lt;/a&gt; is an attempt to combine a PipelineUpdateDefinition with another UpdateDefinition.&lt;/p&gt;</comment>
                            <comment id="5616431" author="JIRAUSER1274316" created="Mon, 7 Aug 2023 09:18:23 +0000"  >&lt;p&gt;As suspected, this issue shows up in search results for: &lt;ins&gt;&lt;a href=&quot;https://www.google.com/search?q=&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://www.google.com/search?q=&lt;/a&gt;&quot;&lt;b&gt;&amp;lt;email address&amp;gt;&lt;/b&gt;&quot;&lt;/ins&gt; &#129764;&lt;/p&gt;</comment>
                            <comment id="5616404" author="JIRAUSER1274316" created="Mon, 7 Aug 2023 08:54:34 +0000"  >&lt;p&gt;Also the &lt;ins&gt;&lt;b&gt;Status&lt;/b&gt;&lt;/ins&gt; needs updating &#128578;&lt;/p&gt;</comment>
                            <comment id="5616382" author="JIRAUSER1274316" created="Mon, 7 Aug 2023 08:35:39 +0000"  >&lt;p&gt;@&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=robert%40mongodb.com&quot; class=&quot;user-hover&quot; rel=&quot;robert@mongodb.com&quot;&gt;robert@mongodb.com&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;&lt;p&gt;You are aware that your email address is part of your Jira user name right? That we have no control over.&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;Hmm, I see, do the admin(s) of the MongoDB JIRA have a mode of contact for external users?&lt;/p&gt;

&lt;p&gt;By the way, as you are aware, this email address visibility issue affects &lt;em&gt;all&lt;/em&gt; users, &lt;b&gt;including MongoDB employees.&lt;/b&gt;&lt;/p&gt;</comment>
                            <comment id="5616039" author="rstam" created="Sun, 6 Aug 2023 22:04:16 +0000"  >&lt;p&gt;Thank you for reporting this. I am able to reproduce the exception you are seeing (though I did have to guess at your class declarations to be able to compile and run a test).&lt;/p&gt;

&lt;p&gt;We will investigate further and let you know what the root cause is and what we can do about it.&lt;/p&gt;</comment>
                            <comment id="5616034" author="rstam" created="Sun, 6 Aug 2023 21:53:59 +0000"  >&lt;p&gt;A B, I have edited the PM Bot comment so that &quot;A B&quot; is not a link.&lt;/p&gt;

&lt;p&gt;You are aware that your email address is part of your Jira user name right? That we have no control over.&lt;/p&gt;</comment>
                            <comment id="5615557" author="JIRAUSER1274316" created="Sat, 5 Aug 2023 18:07:21 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=james.kovacs%40mongodb.com&quot; class=&quot;user-hover&quot; rel=&quot;james.kovacs@mongodb.com&quot;&gt;james.kovacs@mongodb.com&lt;/a&gt; hi, could you please remove the first comment from &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=dbeng-pm-bot&quot; class=&quot;user-hover&quot; rel=&quot;dbeng-pm-bot&quot;&gt;dbeng-pm-bot&lt;/a&gt;, my email address is publicly visible when not logged in (Hi &lt;tt&gt;&amp;lt;email&amp;gt;&lt;/tt&gt;).&lt;/p&gt;</comment>
                            <comment id="5615543" author="dbeng-pm-bot" created="Sat, 5 Aug 2023 17:08:18 +0000"  >&lt;p&gt;Hi A B, thank you for reporting this issue! The team will look into it and get back to you soon.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                            <outwardlinks description="related to">
                                        <issuelink>
            <issuekey id="2111728">CSHARP-4293</issuekey>
        </issuelink>
                            </outwardlinks>
                                                                <inwardlinks description="is related to">
                                        <issuelink>
            <issuekey id="2411313">CSHARP-4746</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="2411322">CSHARP-4747</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_15850" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_14266" key="com.atlassian.jira.plugin.system.customfieldtypes:textarea">
                        <customfieldname>Documentation Changes Summary</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>&lt;p&gt;1.  What would you like to communicate to the user about this feature?&lt;br/&gt;
2.  Would you like the user to see examples of the syntax and/or executable code and its output?&lt;br/&gt;
3.  Which versions of the driver/connector does this apply to?&lt;/p&gt;</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|i2343k:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>9223372036854775807</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            </customfields>
    </item>
</channel>
</rss>