× Heads up!

Aqua Data Studio / nhilam

Follow
IDE for Relational Databases
×
slavakiev reported 2013-07-25T17:55:20Z  · last modified 2013-08-02T18:20:12Z

COUNT() when working through MongoDB .count statement counts null values


Priority Low
Complexity Unknown
Component MongoSQL
Version 14.0

Tested Aqua Data Studio Aqua Data Studio 14.0.0-beta-68 Build #: 33238 on Ubuntu 12.04( Mongo DB 2.4.3)  and Windows XP ( Mongo DB 2.0.9).

In the ticket 9654 Jenny states that Mogngo SQL should not count NULL values in GROUP BY as other RDBMS do this. But we have situation that NULL values counted when regular .count() statement used. See next scripset:

drop collection nullcoll

go 
insert into nullcoll(a,b) values (1,1)
go
insert into nullcoll(a,b) values (null,2)
go
insert into nullcoll(b) values (3)
go

select count(a) from nullcoll 

go
--  count(a)
--    2
select a,count(a) from nullcoll group by a having field_exists(a)
go
--  a     count(a)
--(null)  0
--    1   1
 

So without group by count=2 but with group by 0+1=1 

Issue #9658

Closed
Fixed
Resolved 2013-07-31T17:13:26Z
 
 
Completion
No due date
Fixed Build ADS 14.0.0-beta-76 (mongo-jdbc 1.2.6)
No time estimate

About AquaClusters Privacy Policy Support Version - 19.0.2-4 AquaFold, Inc Copyright © 2007-2017