[SERVER-2188] Check count code path when using $min and $max Created: 07/Dec/10  Updated: 19/May/14  Resolved: 20/Dec/10

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: 1.7.3
Fix Version/s: None

Type: Bug Priority: Minor - P4
Reporter: Alberto Lerner Assignee: Alberto Lerner
Resolution: Won't Fix Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Operating System: ALL
Participants:

 Description   

s = ""
function z()

{ return Math.floor( Math.random() * 1000 ); }

for ( i=0; i<10000; i++ ){ db.foo2.insert(

{ s : s , a : z() , b : z()}

); }

shard on a,b and make a couple of split points

db.bar.find( { $min:

{ a: 0, b: 0}

, $max:

{ a:1000, b:1000}

, $query: {} } ).itcount()

gives the correct count, but

db.bar.find( { $min:

{ a: 0, b: 0}

, $max:

{ a:1000, b:1000}

, $query: {} } ).count()

doesn't



 Comments   
Comment by Alberto Lerner [ 20/Dec/10 ]

The usage of $min / $max is not supported yet.

To get the functionality, we use the shell version of these functions:
db.foo.find().min()
db.foo.find().max()

http://www.mongodb.org/display/DOCS/min+and+max+Query+Specifiers

Generated at Thu Feb 08 02:59:13 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.