<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Wed Feb 07 21:47:39 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-4240] Feedback on Atlas Search Using C# Driver + Documents in BSON</title>
                <link>https://jira.mongodb.org/browse/CSHARP-4240</link>
                <project id="10041" key="CSHARP">C# Driver</project>
                    <description>&lt;p&gt;Sharing feedback from client organization on Atlas Search using the C# driver:&lt;br/&gt;
&#160;&lt;br/&gt;
For normal Finds and Aggregations, I can write idiomatic C# with a fluent builder API. I can use all the LINQ features I&apos;m used to having on other data structures and database providers.For $search (and $searchMeta!)...I have to either # write the BSON as a string (and worry about escaping query strings properly)&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;Create nested BsonDocument objects, which gets complicated and nasty&#160;&lt;em&gt;very&lt;/em&gt;&#160;quickly. We ended up writing the helpers in this snippet (and more), which help but are still hard to read. And easy to get wrong if we mess up the structure of the object.&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;A normal find query, with all the type-safe &quot;if it builds, it works&quot; LINQ goodness:&lt;br/&gt;
// normal collection Find (where if it builds, it works)&lt;br/&gt;
collection&lt;br/&gt;
	.Find(x =&amp;gt; x.AnArrayField.Contains(someId))&lt;br/&gt;
	.SortByDescending(x =&amp;gt; x.ADateField)&lt;br/&gt;
	.Project(x =&amp;gt; new SomeModel(x.Id, x.Value1, x.Value2))&lt;br/&gt;
	.ToList();&lt;br/&gt;
&#160;&lt;br/&gt;
// Atlas Search stuff...where if it builds, we&apos;re still not sure it will work&lt;br/&gt;
&#8203;&lt;br/&gt;
// create text search operator with score boost&lt;br/&gt;
private BsonDocument SearchFieldWithBoost(string field, string value, int Boost)&lt;/p&gt;
{
return new(&quot;text&quot;,
new BsonDocument(&quot;query&quot;, value)
.AddRange(new BsonDocument(&quot;path&quot;, field))
.AddRange(new BsonDocument(&quot;score&quot;,
new BsonDocument(&quot;boost&quot;,
new BsonDocument(&quot;value&quot;, Boost)
)))
);
}
&lt;p&gt;&#8203;&lt;br/&gt;
// Add text search operator with fuzzy parameters&lt;br/&gt;
private BsonDocument GetTextFuzzyStage(string field, string value)&lt;/p&gt;
{
return new(&quot;text&quot;,
new BsonDocument(&quot;query&quot;, value)
.AddRange(new BsonDocument(&quot;path&quot;, field))
.AddRange(new BsonDocument(&quot;fuzzy&quot;,
new BsonDocument(&quot;maxEdits&quot;, 2)
.AddRange(new BsonDocument(&quot;prefixLength&quot;, 2))
)
)
);
}
&lt;p&gt;&#8203;&lt;br/&gt;
// add numeric filter&lt;br/&gt;
private BsonDocument GetIntEqualsStage(string field, int value)&lt;/p&gt;
{
return new(&quot;range&quot;,
new BsonDocument(&quot;path&quot;, field)
.AddRange(new BsonDocument(&quot;gte&quot;, value))
.AddRange(new BsonDocument(&quot;lte&quot;, value))
);
}
&lt;p&gt;&#8203;&lt;br/&gt;
// combine must, should, and filter arrays to build compound operator&lt;br/&gt;
private BsonDocument BuildCompoundStage(BsonArray should, BsonArray must, BsonArray filter)&lt;/p&gt;
{
var compoundStage = new BsonDocument();
if (must.Any()) compoundStage.AddRange(new BsonDocument(&quot;must&quot;, must));
if (should.Any()) compoundStage.AddRange(new BsonDocument(&quot;should&quot;, should));
if (filter.Any()) compoundStage.AddRange(new BsonDocument(&quot;filter&quot;, filter));
return new BsonDocument(&quot;compound&quot;, compoundStage);
}
&lt;p&gt;&#160;&lt;br/&gt;
A basic user story the user offered is, &quot;As a developer, I would like to use a fluent API and lambda expressions to build $search/$searchMeta aggregation stages that I can be confident are correctly written*.*i.e. only uses fields that are defined in my document model and only uses operators/options that are supported by Search with no typos.&quot;&lt;/p&gt;</description>
                <environment></environment>
        <key id="2078966">CSHARP-4240</key>
            <summary>Feedback on Atlas Search Using C# Driver + Documents in BSON</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="3">Duplicate</resolution>
                                        <assignee username="-1">Unassigned</assignee>
                                    <reporter username="angie.shaw@mongodb.com">Angie Shaw</reporter>
                        <labels>
                    </labels>
                <created>Tue, 28 Jun 2022 19:53:30 +0000</created>
                <updated>Fri, 6 Jan 2023 20:59:26 +0000</updated>
                            <resolved>Fri, 6 Jan 2023 20:59:18 +0000</resolved>
                                                                                        <votes>1</votes>
                                    <watches>5</watches>
                                                                                                                <comments>
                            <comment id="4658955" author="james.kovacs" created="Tue, 5 Jul 2022 21:45:07 +0000"  >&lt;p&gt;Thank you for your feedback. We recently implemented &lt;tt&gt;$search&lt;/tt&gt; support for our Java Driver in &lt;a href=&quot;https://jira.mongodb.org/browse/JAVA-4415&quot; title=&quot;Add builder for $search stage&quot; class=&quot;issue-link&quot; data-issue-key=&quot;JAVA-4415&quot;&gt;&lt;del&gt;JAVA-4415&lt;/del&gt;&lt;/a&gt;. We would like to do the same for the .NET/C# Driver, but this work hasn&apos;t been prioritized yet. We will take your feedback into account during our next planning cycle. Please follow this ticket for updates on when we decide to implement this functionality.&lt;/p&gt;</comment>
                            <comment id="4655766" author="rachelle.palmer" created="Mon, 4 Jul 2022 15:30:22 +0000"  >&lt;p&gt;Moving to C# driver queue for review (and action, if any)&lt;/p&gt;</comment>
                            <comment id="4647623" author="elle.shwer" created="Wed, 29 Jun 2022 13:34:12 +0000"  >&lt;p&gt;btw &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=rachelle.palmer%40mongodb.com&quot; class=&quot;user-hover&quot; rel=&quot;rachelle.palmer@mongodb.com&quot;&gt;rachelle.palmer@mongodb.com&lt;/a&gt;&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10010">
                    <name>Duplicate</name>
                                            <outwardlinks description="duplicates">
                                        <issuelink>
            <issuekey id="2200806">CSHARP-4440</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_21553" key="com.atlassian.jira.plugin.system.customfieldtypes:labels">
                        <customfieldname>Quarter</customfieldname>
                        <customfieldvalues>
                                        <label>FY23Q4</label>
    
                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|i0j7xc:</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>