[CSHARP-1272] FindFluent.SizeAsync() Created: 08/May/15 Updated: 08/May/15 Resolved: 08/May/15 |
|
| Status: | Closed |
| Project: | C# Driver |
| Component/s: | Feature Request |
| Affects Version/s: | 2.0 |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Minor - P4 |
| Reporter: | Aristarkh Zagorodnikov | Assignee: | Craig Wilson |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Description |
|
I wonder if there are any plans to include a SizeAsync ( |
| Comments |
| Comment by Aristarkh Zagorodnikov [ 08/May/15 ] |
|
I checked the FindFluent.CountAsync source and it takes into account the skip/limit. Thank you again, looks like I should forget some more 1.x stuff =) |
| Comment by Aristarkh Zagorodnikov [ 08/May/15 ] |
|
Thanks for pointing me to the IMongoCollection.CountAsync. And as for Skip->Limit->Count, I was under impression that it would ignore the skip and limit as 1.x driver did, if it's not the case, than that's great! |
| Comment by Craig Wilson [ 08/May/15 ] |
|
Hi Aristarkh, You can pass a CountOptions to CountAsync which can contain both a skip and a limit. http://api.mongodb.org/csharp/2.0/html/M_MongoDB_Driver_IMongoCollection_1_CountAsync.htm In addition, you can use Find and terminate it with a count: Find(x => x.Age > 21).Skip(1).Limit(10).CountAsync() Craig |