Search code examples
mongodbloggingphalconcapped-collections

Is it possible use MongoDb capped collection with phalcon Collection models


I use some mongoDb collection for logs, so I want use MongoDb capped collection.

Can I use phaclon Collection for doing it, or I should code log rotation inside my log model?


Solution

  • I don't think Phalcon supports creation of a capped collection, however, you could create this collection in the MongoDB shell and then use it in Phalcon:

    db.createCollection("log", { capped : true, size : 5242880, max : 5000 } )