<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Wed Feb 07 22:01:32 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>[CXX-1138] uncought exception: find_and_update =&gt; precondition failed: bson</title>
                <link>https://jira.mongodb.org/browse/CXX-1138</link>
                <project id="11980" key="CXX">C++ Driver</project>
                    <description>&lt;p&gt;Hey there,&lt;br/&gt;
I don&apos;t know which statement exactly causes the error. Last time I had this I accidentally changed parameters of the find_and_update - function. Now I finally can reproduce it =).&lt;br/&gt;
Hope this is helpful,&lt;br/&gt;
Armin&lt;/p&gt;

&lt;p&gt;// codesnippets&lt;/p&gt;

&lt;p&gt;{{  mongocxx::options::find_one_and_update TheOptions {};&lt;br/&gt;
  TheOptions.sort(vieOptions);&lt;/p&gt;

&lt;p&gt;    std::cout&lt;br/&gt;
      &amp;lt;&amp;lt; &quot;78 - Find:\n&quot; &amp;lt;&amp;lt; bsoncxx::to_json(vieFind) &amp;lt;&amp;lt; &quot;\n&quot;&lt;br/&gt;
      &amp;lt;&amp;lt; &quot;78 - Update:\n&quot; &amp;lt;&amp;lt; bsoncxx::to_json(vieUpdate) &amp;lt;&amp;lt; &quot;\n&quot;&lt;br/&gt;
      &amp;lt;&amp;lt; &quot;78 - Options.sort:\n&quot; &amp;lt;&amp;lt; bsoncxx::to_json(vieOptions)&lt;br/&gt;
      &amp;lt;&amp;lt; std::endl;&lt;/p&gt;

&lt;p&gt;... collJobs.find_one_and_update(vieFind,vieUpdate,TheOptions);}}&lt;/p&gt;

&lt;p&gt;&lt;b&gt;src/bson/bson.c:2193 bson_get_data(): precondition failed: bson&lt;/b&gt;&lt;br/&gt;
process died.&lt;/p&gt;

&lt;p&gt;// consol:&lt;/p&gt;

&lt;p&gt;78 - Find:&lt;br/&gt;
{&lt;br/&gt;
    &quot;CServer&quot; : {&lt;br/&gt;
        &quot;error&quot; : false, &lt;br/&gt;
        &quot;dateEndLeadworker&quot; : &lt;/p&gt;
{
            &quot;$exists&quot; : true
        }
&lt;p&gt;, &lt;br/&gt;
        &quot;dateStartConversion&quot; : &lt;/p&gt;
{
            &quot;$exists&quot; : false
        }
&lt;p&gt;    }&lt;br/&gt;
}&lt;/p&gt;

&lt;p&gt;78 - Update:&lt;br/&gt;
{&lt;br/&gt;
    &quot;$set&quot; : {&lt;br/&gt;
        &quot;CServer&quot; : {&lt;br/&gt;
            &quot;dateStartConversion&quot; : &lt;/p&gt;
{
                &quot;$date&quot; : 1479621781745
            }
&lt;p&gt;, &lt;br/&gt;
            &quot;machineConversion&quot; : &quot;MyMachine_f29a8bc8aee611e6a05f0024d74d9538&quot;&lt;br/&gt;
        }&lt;br/&gt;
    }&lt;br/&gt;
}&lt;/p&gt;

&lt;p&gt;78 - Options.sort:&lt;br/&gt;
{&lt;br/&gt;
    &quot;CServer&quot; : &lt;/p&gt;
{
        &quot;dateEntry&quot; : 1
    }
&lt;p&gt;}&lt;/p&gt;

&lt;p&gt;// Stacktrace:&lt;/p&gt;

&lt;p&gt;{{__GI_raise (sig=6, sig@entry=6) &lt;br/&gt;
__GI_abort ()   &lt;br/&gt;
bson_get_data ()    &lt;br/&gt;
(anonymous namespace)::find_and_modify(_mongoc_collection_t*, bsoncxx::v_noabi::view_or_value&amp;lt;bsoncxx::v_noabi::document::view, bsoncxx::v_noabi::document::value&amp;gt;, _mongoc_find_and_modify_opts_t const*) ()   &lt;br/&gt;
mongocxx::v_noabi::collection::find_one_and_update(bsoncxx::v_noabi::view_or_value&amp;lt;bsoncxx::v_noabi::document::view, bsoncxx::v_noabi::document::value&amp;gt;, bsoncxx::v_noabi::view_or_value&amp;lt;bsoncxx::v_noabi::document::view, bsoncxx::v_noabi::document::value&amp;gt;, mongocxx::v_noabi::options::find_one_and_update const&amp;amp;) () }}  &lt;/p&gt;</description>
                <environment></environment>
        <key id="333120">CXX-1138</key>
            <summary>uncought exception: find_and_update =&gt; precondition failed: bson</summary>
                <type id="1" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14703&amp;avatarType=issuetype">Bug</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="3">Duplicate</resolution>
                                        <assignee username="rassi">J Rassi</assignee>
                                    <reporter username="Weltenbummler">Armin Ball [X]</reporter>
                        <labels>
                    </labels>
                <created>Sun, 20 Nov 2016 06:24:17 +0000</created>
                <updated>Mon, 21 Nov 2016 20:49:13 +0000</updated>
                            <resolved>Mon, 21 Nov 2016 20:48:53 +0000</resolved>
                                    <version>3.0.1</version>
                                                                        <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="1439420" author="rassi@10gen.com" created="Mon, 21 Nov 2016 20:48:53 +0000"  >&lt;p&gt;Hi there, thanks for reporting this issue.  I&apos;ve reproduced your issue and can confirm that this ticket is a duplicate of &lt;a href=&quot;https://jira.mongodb.org/browse/CXX-986&quot; title=&quot;Invalid error handling in find_and_modify - null pointer access&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CXX-986&quot;&gt;&lt;del&gt;CXX-986&lt;/del&gt;&lt;/a&gt;, which has been fixed since 3.0.1 was released.  Please upgrade to the latest version of the driver (currently 3.0.3) to obtain the fix.&lt;/p&gt;

&lt;p&gt;Please note also that {&quot;CServer&quot;: {&quot;dateEntry&quot; : 1}} is an invalid sort object.  To request an ascending sort on a field with a name of &quot;dateEntry&quot; in a sub-object of a field with a name of &quot;CServer&quot;, you should specify a sort object of { &quot;CServer.dateEntry&quot;: 1} instead.  If you specify an invalid sort object to mongocxx::collection::find_one_and_update(), it should now correctly throw a mongocxx::operation_exception with an appropriate error message.&lt;/p&gt;</comment>
                            <comment id="1438401" author="weltenbummler" created="Sun, 20 Nov 2016 07:37:59 +0000"  >&lt;p&gt;for sorting this works:&lt;br/&gt;
78 - Options.sort:&lt;/p&gt;
{ &quot;dateEntry&quot; : 1 }
&lt;p&gt; // commtented the subdocument.&lt;/p&gt;

&lt;p&gt;  bsoncxx::document::value valOrderBy = document{}&lt;br/&gt;
//    &amp;lt;&amp;lt; SERVER_KEY_SUBDOCUMENT&lt;br/&gt;
//      &amp;lt;&amp;lt; open_document&lt;br/&gt;
        &amp;lt;&amp;lt; SERVER_KEY_DATE_ENTRY &amp;lt;&amp;lt; ascending&lt;br/&gt;
//      &amp;lt;&amp;lt; close_document&lt;br/&gt;
   &amp;lt;&amp;lt; finalize;&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10010">
                    <name>Duplicate</name>
                                            <outwardlinks description="duplicates">
                                        <issuelink>
            <issuekey id="307869">CXX-986</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </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_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hss2d3:</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>