-
Type: Bug
-
Resolution: Done
-
Priority: Minor - P4
-
None
-
Affects Version/s: 2.0.4
-
Component/s: None
-
None
-
Environment:Linux
-
ALL
Hi,
It looks like convertToCapped doesn't recreate indexes on the collection. I'm not sure whether or not it's intended behavior but if it's not a bug it would be nice if the documentation could be updated to reflect the need to recreate indexes.
Thanks.
Steps to replicate:
U:Jeffs-MacBook-Air.local> db.foodle.save(
{ id:1, ts:new Date()})
U:Jeffs-MacBook-Air.local> db.foodle.ensureIndex(
)
U:Jeffs-MacBook-Air.local> db.foodle.stats()
{
"ns" : "test.foodle",
"count" : 1,
"size" : 48,
"avgObjSize" : 48,
"storageSize" : 4096,
"numExtents" : 1,
"nindexes" : 2,
"lastExtentSize" : 4096,
"paddingFactor" : 1,
"flags" : 1,
"totalIndexSize" : 16352,
"indexSizes" :
,
"ok" : 1
}
U:Jeffs-MacBook-Air.local> db.runCommand(
)
{ "ok" : 1 }U:Jeffs-MacBook-Air.local> db.foodle.stats()
{
"ns" : "test.foodle",
"count" : 1,
"size" : 48,
"avgObjSize" : 48,
"storageSize" : 4096,
"numExtents" : 1,
"nindexes" : 0,
"lastExtentSize" : 4096,
"paddingFactor" : 1,
"flags" : 0,
"totalIndexSize" : 0,
"indexSizes" : {
},
"capped" : 1,
"max" : 2147483647,
"ok" : 1
}