Is this normal behavior or a bug?
> db.test.insert({a:1}) > db.test.insert({a:10}) > db.test.insert({a:9}) > db.test.insert({a:4}) > db.test.insert({a:4}) > db.test.insert({a:50}) > > db.test.find().sort({a:1}) { "_id" : ObjectId("507ff0d917258e582f785be1"), "a" : 1 } { "_id" : ObjectId("507ff0e117258e582f785be4"), "a" : 4 } { "_id" : ObjectId("507ff0e217258e582f785be5"), "a" : 4 } { "_id" : ObjectId("507ff0df17258e582f785be3"), "a" : 9 } { "_id" : ObjectId("507ff0dd17258e582f785be2"), "a" : 10 } { "_id" : ObjectId("507ff0e517258e582f785be6"), "a" : 50 } > db.test.remove() > > db.test.insert({a:'a1'}) > db.test.insert({a:'a10'}) > db.test.insert({a:'a20'}) > db.test.insert({a:'a4'}) > db.test.insert({a:'a2'}) > db.test.insert({a:'a4'}) > db.test.insert({a:'a9'}) > > db.test.find().sort({a:1}) { "_id" : ObjectId("507ff10117258e582f785be7"), "a" : "a1" } { "_id" : ObjectId("507ff10317258e582f785be8"), "a" : "a10" } { "_id" : ObjectId("507ff10b17258e582f785beb"), "a" : "a2" } { "_id" : ObjectId("507ff10517258e582f785be9"), "a" : "a20" } { "_id" : ObjectId("507ff10817258e582f785bea"), "a" : "a4" } { "_id" : ObjectId("507ff11317258e582f785bec"), "a" : "a4" } { "_id" : ObjectId("507ff11517258e582f785bed"), "a" : "a9" }
I thought it will sort a1, a2, a4,... , a10, a20