<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Wed Feb 07 21:40:09 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-1612] Moving code from 1.x to 2.x</title>
                <link>https://jira.mongodb.org/browse/CSHARP-1612</link>
                <project id="10041" key="CSHARP">C# Driver</project>
                    <description>&lt;p&gt;I&apos;m trying to port my code from the C# 1.x driver to the 2.x&lt;/p&gt;

&lt;p&gt;I was able to translate the queries to 2.x where I had trouble is with GridFS Upload and Delete was giving me trouble because I used GUIDs for IDs and 2.x wanted ObjectID.&lt;/p&gt;

&lt;p&gt;I attached my code file, the methods that gave me issues were SaveAttachment and DeleteEmail&lt;/p&gt;

&lt;p&gt;Delete email because I&apos;m trying to delete the JSON doc and the associated GridFS file&lt;/p&gt;

&lt;p&gt;For now I&apos;m using the 2.x MongoDB.Driver.Legacy and keeping my code as is but I would like to rewrite this code to 2.x format.  I do need this code to run against a current 2.4 database and schema and I&apos;m trying to future proof it to be 3.2 compatible when the MongoDB instances get upgraded to 3.2.&lt;/p&gt;</description>
                <environment>Windows 7, Windows Server 2012</environment>
        <key id="274540">CSHARP-1612</key>
            <summary>Moving code from 1.x to 2.x</summary>
                <type id="3" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14718&amp;avatarType=issuetype">Task</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="9">Done</resolution>
                                        <assignee username="-1">Unassigned</assignee>
                                    <reporter username="peter.bielek@cscglobal.com">Peter Bielek</reporter>
                        <labels>
                            <label>question</label>
                    </labels>
                <created>Wed, 23 Mar 2016 14:32:26 +0000</created>
                <updated>Fri, 5 Apr 2019 13:59:00 +0000</updated>
                            <resolved>Mon, 16 May 2016 17:35:14 +0000</resolved>
                                    <version>1.10.1</version>
                    <version>2.2.3</version>
                                                    <component>BSON</component>
                    <component>GridFS</component>
                                        <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="1213104" author="rstam" created="Wed, 23 Mar 2016 20:55:05 +0000"  >&lt;p&gt;The goal is for the Legacy API to be dropped eventually.&lt;/p&gt;

&lt;p&gt;We have not yet determined a date for that to happen.&lt;/p&gt;</comment>
                            <comment id="1213094" author="peter.bielek@cscglobal.com" created="Wed, 23 Mar 2016 20:52:32 +0000"  >&lt;p&gt;When would you expect the &quot;Legacy&quot; mode of the 2.x driver to fall off? Is there a end of life for that feature? &lt;/p&gt;</comment>
                            <comment id="1212987" author="rstam" created="Wed, 23 Mar 2016 19:32:11 +0000"  >&lt;p&gt;Schema migrations are always awkward. Your options are:&lt;/p&gt;

&lt;p&gt;1. Run an offline script/program to modify all existing data to conform to the new schema&lt;br/&gt;
2. Write your program to accept a mix of the old and new schema data (new data is written in the new schema, existing data remains in the old schema)&lt;/p&gt;

&lt;p&gt;The second option has the advantage of not requiring any downtime, at the cost of slightly more complicated code.&lt;/p&gt;

&lt;p&gt;In this case if you simply copy the _id of all existing GridFS documents to a new &lt;/p&gt;
{ metadata.attachment_id } field and also put the GUID of all new GridFS files in the same { metadata.attachment_id }
&lt;p&gt; field your schema migration is pretty minimal.&lt;/p&gt;

&lt;p&gt;You can leave the _id&apos;s of all existing GridFS files alone, while new GridFS files will have an _id that is an ObjectId and have your attachment_id in the metadata field. It wouldn&apos;t really matter that existing files have an _id that is not an ObjectId (though you&apos;ll have to use a deprecated overload of DownloadXyz to read them).&lt;/p&gt;</comment>
                            <comment id="1212892" author="peter.bielek@cscglobal.com" created="Wed, 23 Mar 2016 18:41:17 +0000"  >&lt;p&gt;Unfortunately both options require me to update the current data in the  2.4 instance to support the new code.  I was hoping to not have to reformat the data. &lt;br/&gt;
Or am I missing something?&lt;/p&gt;</comment>
                            <comment id="1212602" author="rstam" created="Wed, 23 Mar 2016 16:14:16 +0000"  >&lt;p&gt;The 2.x implementation of GridFS follows the new GridFS spec, which is intended to provide identical GridFS support across all drivers.&lt;/p&gt;

&lt;p&gt;The new GridFS spec does not allow an application to set the id of the uploaded file.&lt;/p&gt;

&lt;p&gt;Some options for you are:&lt;/p&gt;

&lt;p&gt;1. convert the GUID to a string and use it as the filename&lt;br/&gt;
2. add the GUID to the Metadata in the GridFSUploadOptions&lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                            <attachment id="114638" name="DbRepository.cs" size="7889" author="peter.bielek@cscglobal.com" created="Wed, 23 Mar 2016 14:32:26 +0000"/>
                    </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|hsjpdr:</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>