Nat,
this is db.items.stats() result:
> db.items.stats()
{
"ns" : "db1.items",
"count" : 7257084,
"size" : 10612484056,
"avgObjSize" : 1462.3620252983153,
"storageSize" : 11907873536,
"numExtents" : 36,
"nindexes" : 14,
"lastExtentSize" : 1991168256,
"paddingFactor" : 1.0099999999170273,
"flags" : 1,
"totalIndexSize" :
7737619584,
"indexSizes" : {
"_id_" : 243205056,
"id_domain_1" : 413238208,
"id_feed_1" : 400917440,
"id_site_1" : 381559744,
"url_1" : 1451230144,
"crc_1" : 306054080,
"keyword.proc_1" : 272532416,
"keyword.list_1" : 1697366976,
"image.proc_1" : 269648832,
"enabled_1" : 309552064,
"check_1" : 265028544,
"solr_1" : 405275584,
"date_1" : 348611520,
"image.url_1" : 973398976
},
"ok" : 1
}
I have try to use find() instead of count() but i have always the same
results.
[PHP]
<?php
$count = $mongo->selectDB('db1')->selectCollection('items')-
>find( array( 'keyword.list' => 3 ), array( '_id' => 1, 'keyword.list'
=> 1 ) )->timeout(-1);
foreach( $count as $item )
print_r( $item );
$count->count() . "\n";
?>
Total record is 48.
Row result sample:
Array
(
[_id] => 52927115
[keyword] => Array
(
[list] => Array
(
[0] => 3
[1] => 214
[2] => 2003
[3] => 2016
[4] => 2019
[5] => 2020
)
)
)
Array
(
[_id] => 52927019
[keyword] => Array
(
[list] => Array
(
[0] => 3
[1] => 6
[2] => 1475
[3] => 1504
[4] => 36017
)
)
)
Array
(
[_id] => 52926931
[keyword] => Array
(
[list] => Array
(
[0] => 3
[1] => 144
[2] => 2366
)
)
)
[CLIENT]
> db.items.find( { 'keyword.list': 3 }, { 'keyword.list': 1} )
Total record is 8029.
Row result sample:
{ "_id" : 9358927, "keyword" : { "list" : [ 3, 263, 1475 ] } }
{ "_id" : 9358973, "keyword" : { "list" : [ 3, 1475, 1512 ] } }
{ "_id" : 9359208, "keyword" : { "list" : [ 3 ] } }
{ "_id" : 9359456, "keyword" : { "list" : [ 3, 12, 217, 231, 249,
2324, 2340 ] } }
{ "_id" : 9360295, "keyword" : { "list" : [ 3, 1197, 1216, 1340,
29952 ] } }
{ "_id" : 9360333, "keyword" : { "list" : [ 3, 20, 250, 933 ] } }
{ "_id" : 9360334, "keyword" : { "list" : [ 3, 1475 ] } }
I have try to execute the query with value 1475 and the result row is
the same: 265634