<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Wed Feb 07 21:44:11 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-3034] How to Mimic the [JsonProperty(IsReference = true)] feature of JSON NewtonSoft .NET C#</title>
                <link>https://jira.mongodb.org/browse/CSHARP-3034</link>
                <project id="10041" key="CSHARP">C# Driver</project>
                    <description>&lt;p&gt;We are currently migrating from RavenDB to MongoDB and are unable to find an equivalent feature of NewtonSofts &lt;span class=&quot;error&quot;&gt;&amp;#91;JsonProperty(IsReference = true)&amp;#93;&lt;/span&gt; .&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://www.newtonsoft.com/json/help/html/PreserveObjectReferences.htm&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://www.newtonsoft.com/json/help/html/PreserveObjectReferences.htm&#160;1&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Does MongoDB Currently have a built in way to mimic this? If not how would i go about doing such a custom implementation myself with the drivers currenty customization hooks?&lt;/p&gt;</description>
                <environment></environment>
        <key id="1296840">CSHARP-3034</key>
            <summary>How to Mimic the [JsonProperty(IsReference = true)] feature of JSON NewtonSoft .NET C#</summary>
                <type id="4" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14710&amp;avatarType=issuetype">Improvement</type>
                                            <priority id="3" iconUrl="https://jira.mongodb.org/images/icons/priorities/major.svg">Major - P3</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="13202">Works as Designed</resolution>
                                        <assignee username="robert@mongodb.com">Robert Stam</assignee>
                                    <reporter username="michael_fyffe@homedepot.com">Michael Fyffe</reporter>
                        <labels>
                    </labels>
                <created>Mon, 30 Mar 2020 15:29:28 +0000</created>
                <updated>Fri, 27 Oct 2023 13:24:52 +0000</updated>
                            <resolved>Tue, 7 Apr 2020 18:32:47 +0000</resolved>
                                    <version>2.10.2</version>
                                                    <component>Serialization</component>
                                        <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="3029982" author="rstam" created="Tue, 7 Apr 2020 18:32:39 +0000"  >&lt;p&gt;The MongoDB C# driver does not currently have a feature similar to Json.NET&apos;s IsReference option and we have no plans at the moment to support that.&lt;/p&gt;

&lt;p&gt;You are able to write and register custom serializers, so there might be a way to accomplish this, but I don&apos;t have any concrete advice on how you might do that. Seems like the main technical issue is that when the C# driver calls a a serializer (for example a PersonSerializer for a Person object using the example from the Json.NET documentation) the PersonSerializer has no way of knowing anything about the surrounding context it was called in, so not sure how it would know to add a `$id` to the first Person object serialized and to serialize a `$ref` instead of a full Person document when called with a duplicate instance.&lt;/p&gt;

&lt;p&gt;Sorry I don&apos;t have better news for you.&lt;/p&gt;</comment>
                    </comments>
                    <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_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hwzylz:</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>