Details
-
Bug
-
Resolution: Duplicate
-
Major - P3
-
None
-
1.7.4
-
None
-
ALL
Description
//wrong order
db.games.find().sort(
);
{ "_id" : "game-20101124-185512-c86779ce.html", "decks" : [
,
{ "points" : 42 } ] }
{ "_id" : "game-20101124-171239-da3d89e2.html", "decks" : [
,
{ "points" : 33 } ] }
{ "_id" : "game-20101124-204302-026f72ee.html", "decks" : [
,
{ "points" : 36 },
{ "points" : 28 } ] }
{ "_id" : "game-20101124-083714-3cc1743c.html", "decks" : [
,
{ "points" : 42 } ] }
{ "_id" : "game-20101124-013048-26973e9a.html", "decks" : [
,
{ "points" : 29 }] }
db.games.ensureIndex(
{"decks.points": -1})
//correct order
db.games.find().sort(
);
{ "_id" : "game-20101124-185512-c86779ce.html", "decks" : [
,
{ "points" : 42 } ] }
{ "_id" : "game-20101124-171239-da3d89e2.html", "decks" : [
,
{ "points" : 33 } ] }
{ "_id" : "game-20101124-083714-3cc1743c.html", "decks" : [
,
{ "points" : 42 } ] }
{ "_id" : "game-20101124-013048-26973e9a.html", "decks" : [
,
{ "points" : 29 } ] }
{ "_id" : "game-20101124-204302-026f72ee.html", "decks" : [
,
{ "points" : 36 },
{ "points" : 28 } ] }
> db.decks.dropIndex(