Sorry I think I look into the wrong way. After double check, I am able to query the data with query by range (also using java driver) like
db.mycollection.find({"_id": { $gte: ObjectId("55cf6a4cafd6a72e4bb33e1e"), $lt: ObjectId("55cf6a4cafd6a72e4bb33f69")}})
But I have a few more questions now. Apology to change questions that may not match to my original one.
Basically I customize my own logic based on mongo connector - find chunks in shards, etc. (It's interesting to learn how mongo related internal logic is working). And I compare the output (chunks and shards info) based on my logic with db.printShardingStatus(), the result shows that the number is the same. For instance,
db.printShardingStatus() result: (shard key is "_id")
{
shard key: { "_id" : 1 }
chunks:
shard0000 17
shard0001 17
shard0002 16
shard0003 16
}
My code output result:
4 shards with 66 chunks
shard0003 16
shard0000 17
shard0002 16
shard0001 17
But I find that when looping through those chunks (connecting to shard directly) the total records doesn't match the count in mongo shell. For example, db.mycollection.find().count() displays 2640 records, but the data found through mongo driver with the same query only gives around 340 records (two processes that process 200 + 140). Does that mean one can't simply obtain data through chunks range? Any other additional steps are needed so that one can have separates processes with each to read partial data from mongodb in achieving the effect like mapreduce?
Thanks