Terjemahan disediakan oleh mesin penerjemah. Jika konten terjemahan yang diberikan bertentangan dengan versi bahasa Inggris aslinya, utamakan versi bahasa Inggris. Show Amazon DocumentDB (dengan kompatibilitas MongoDB) adalah layanan basis data dokumen yang cepat, dapat diskalakan, sangat tersedia, dan terkelola penuh yang mendukung beban kerja MongoDB. Amazon DocumentDB kompatibel dengan API MongoDB 3.6 dan 4.0. Bagian ini mencantumkan fungsionalitas yang didukung. Untuk dukungan menggunakan API dan driver MongoDB, silakan berkonsultasi dengan Forum Komunitas MongoDB. Untuk dukungan menggunakan layanan Amazon DocumentDB, silakan hubungi tim dukungan AWS yang sesuai. Untuk perbedaan fungsional antara Amazon DocumentDB dan MongoDB, silakan lihat Perbedaan Fungsional: Amazon DocumentDB dan MongoDB. Perintah dan operator MongoDB yang hanya berlaku untuk internal atau tidak berlaku untuk layanan terkelola penuh tidak didukung dan tidak termasuk dalam daftar fungsi yang didukung. Kami telah menambahkan lebih dari 50+ kemampuan tambahan sejak diluncurkan, dan akan terus bekerja mundur dari pelanggan kami untuk memberikan kemampuan yang mereka butuhkan. Untuk informasi tentang peluncuran terbaru, lihat Pengumuman Amazon DocumentDB. Jika ada fitur yang tidak didukung yang Anda ingin kami bangun, beri tahu kami dengan mengirimkan email dengan accountID Anda, fitur yang diminta, dan kasus penggunaan ke tim layanan Amazon DocumentDB. When you create a , you can set up automatic removal of documents older than a specified number of seconds by using the expireAfterSeconds parameter:
The expiration threshold is the 0 field value plus the specified number of seconds. Consider the following document in the 1 collection:
The document would expire from the database at 2. Once all documents in a bucket are expired, the background task that removes expired buckets removes the bucket during the next run. See for more information.Enable Automatic Removal on a CollectionTo enable automatic removal of documents for an existing , issue the following command:
Change the expireAfterSeconds ParameterTo change the
Retrieve the Current Value of expireAfterSecondsTo retrieve the current value of
The result document contains a document for the time series collection which contains the 0 field.
Disable Automatic RemovalTo disable automatic removal, use the command to set 3:
BehaviorTiming of Delete OperationsMongoDB doesn't guarantee that expired data will be deleted immediately upon expiration. Once all documents in a bucket are expired, the background task that removes expired buckets removes the bucket during the next run. The maximum span of time that a single bucket is allowed to cover is controlled by the 4 of the time series collection:
Covered Time Span
one hour
24 hours
30 days The background task that removes expired buckets runs every 60 seconds. Therefore, documents may remain in a collection during the period between the expiration of the document, the expiration of all other documents in the bucket and the running of the background task. Because the duration of the removal operation depends on the workload of your mongod instance, expired data may exist for some time beyond the 60 second period between runs of the background task. |