<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Wed Feb 07 21:40: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-1638] MongoDB Driver 2.2.3 IMongoCollection paging</title>
                <link>https://jira.mongodb.org/browse/CSHARP-1638</link>
                <project id="10041" key="CSHARP">C# Driver</project>
                    <description>&lt;p&gt;Hi,&lt;br/&gt;
I upgrade my driver to 2.2.3 &lt;br/&gt;
In my previous version I 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;   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;MongoCollection.AsQueryable&amp;lt;TEntity&amp;gt;().Skip(skip).Take(count); &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 can query with database pagination with MongoCollection.&lt;/p&gt;

&lt;p&gt;new driver I change it to IMongoCollection&lt;/p&gt;

&lt;p&gt;IMongoCollection.AsQueryable&amp;lt;TEntity&amp;gt;().Skip(skip).Take(count)&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;   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;{aggregate([{ &quot;$skip&quot; : 0 }, { &quot;$limit&quot; : 10 }, { &quot;$match&quot; : { &quot;Name&quot; : &quot;a&quot; } }])}&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;For example&lt;br/&gt;
with this query (I want to take 10 record)  It get first ten records and then if two of them matches I get  two record as a result.&lt;/p&gt;

&lt;p&gt;But I want to get first ten records which Name is a,and with this I can make database pagination.With old driver I brings first ten records which matches a,What should I do to achive database pagination in new driver with IMongoCollection&lt;/p&gt;

&lt;p&gt;Thanks&lt;/p&gt;</description>
                <environment></environment>
        <key id="282479">CSHARP-1638</key>
            <summary>MongoDB Driver 2.2.3 IMongoCollection paging</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="biyildiz">Bilgehan</reporter>
                        <labels>
                            <label>question</label>
                    </labels>
                <created>Tue, 26 Apr 2016 14:29:51 +0000</created>
                <updated>Fri, 5 Apr 2019 13:58:05 +0000</updated>
                            <resolved>Mon, 16 May 2016 17:21:09 +0000</resolved>
                                    <version>2.2.3</version>
                                                                        <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="1247523" author="biyildiz" created="Wed, 27 Apr 2016 06:29:29 +0000"  >&lt;p&gt;Hi Craig&lt;/p&gt;

&lt;p&gt;You are right,I can able to do that change query &lt;/p&gt;

&lt;p&gt;{aggregate([{ &quot;$match&quot; : &lt;/p&gt;
{ &quot;Name&quot; : a }
&lt;p&gt; }, &lt;/p&gt;
{ &quot;$skip&quot; : 40 }
&lt;p&gt;, &lt;/p&gt;
{ &quot;$limit&quot; : 10 }
&lt;p&gt;])} ,&lt;/p&gt;

&lt;p&gt;As I see implementation is change in new driver I can use as I said in previous version.&lt;/p&gt;

&lt;p&gt;I change my code&lt;/p&gt;

&lt;p&gt;Thanks for your help&lt;/p&gt;</comment>
                            <comment id="1246710" author="craiggwilson" created="Tue, 26 Apr 2016 14:35:49 +0000"  >&lt;p&gt;Hi Bilgehan,&lt;/p&gt;

&lt;p&gt;Queryable&apos;s are order sensitive. In other words, if you do a Skip and Take before a Where, then that&apos;s the order in which things are going to happen. Hence, you need to add your paging information at the end, right before execution as opposed to at the beginning.&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;   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;AsQueryable().Where(x =&amp;gt; x.Name == &quot;a&quot;).Skip(0).Take(10);&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;Let me know if this needs further explanation.&lt;br/&gt;
Craig&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|hsktdj:</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>