|
I'm seeing it on 2.4.8:
$ cat test.js
|
printjson(db.serverBuildInfo());
|
db.collection.drop();
|
db.collection.insert({a:1});
|
db.collection.insert({});
|
printjson(db.collection.distinct('a'));
|
db.collection.createIndex({a:1});
|
printjson(db.collection.distinct('a'));
|
|
|
$ mongo test.js
|
MongoDB shell version: 2.4.8
|
connecting to: test
|
{
|
"version" : "2.4.8",
|
"gitVersion" : "a350fc38922fbda2cec8d5dd842237b904eafc14",
|
"sysInfo" : "Darwin bs-osx-106-x86-64-2.10gen.cc 10.8.0 Darwin Kernel Version 10.8.0: Tue Jun 7 16:32:41 PDT 2011; root:xnu-1504.15.3~1/RELEASE_X86_64 x86_64 BOOST_LIB_VERSION=1_49",
|
"loaderFlags" : "-fPIC -pthread -rdynamic -m64",
|
"compilerFlags" : "-Wnon-virtual-dtor -Woverloaded-virtual -fPIC -fno-strict-aliasing -ggdb -pthread -Wall -Wsign-compare -Wno-unknown-pragmas -Winvalid-pch -O3 -m64",
|
"allocator" : "system",
|
"versionArray" : [
|
2,
|
4,
|
8,
|
0
|
],
|
"javascriptEngine" : "V8",
|
"bits" : 64,
|
"debug" : false,
|
"maxBsonObjectSize" : 16777216,
|
"ok" : 1
|
}
|
[ 1 ]
|
[ null, 1 ]
|
However, on the 11/15 nightly it's fixed, so I guess we can close this:
$ mongo test.js
|
MongoDB shell version: 2.5.4-pre-
|
connecting to: test
|
{
|
"version" : "2.5.4-pre-",
|
"gitVersion" : "58b3bbcc1c366185cfbf9b8551a4c7150f6553d9",
|
"OpenSSLVersion" : "",
|
"sysInfo" : "Darwin mci-osx108-8.build.10gen.cc 12.5.0 Darwin Kernel Version 12.5.0: Sun Sep 29 13:33:47 PDT 2013; root:xnu-2050.48.12~1/RELEASE_X86_64 x86_64 BOOST_LIB_VERSION=1_49",
|
"loaderFlags" : "-fPIC -pthread -Wl,-bind_at_load -mmacosx-version-min=10.6",
|
"compilerFlags" : "-Wnon-virtual-dtor -Woverloaded-virtual -fPIC -fno-strict-aliasing -ggdb -pthread -Wall -Wsign-compare -Wno-unknown-pragmas -Winvalid-pch -Werror -pipe -O3 -Wno-unused-function -Wno-deprecated-declarations -mmacosx-version-min=10.6",
|
"allocator" : "system",
|
"versionArray" : [
|
2,
|
5,
|
4,
|
-100
|
],
|
"javascriptEngine" : "V8",
|
"bits" : 64,
|
"debug" : false,
|
"maxBsonObjectSize" : 16777216,
|
"ok" : 1
|
}
|
[ 1 ]
|
[ 1 ]
|
|