Are capped arrays created automatically everytime you add an array to a document, or is there a command you must enter?
Here is the command for capped collections:
db.createCollection( "log", { capped: true, size: 100000 } )
From what I read, you only have to use the $slice
command. Can anyone confirm this?
Thanks
Try using the
$slice
operator for your capped array, as explained in this post about MongoDB 2.4.Such as with
$slice: [capValue]
in your query.Hope that helps!