Автоматический срок действия документа в MongoDB
> db.notifications.createIndex({"createdAt":1,"text":1}, {expireAfterSeconds:86400})
{
"operationTime" : Timestamp(1599925286, 1),
"ok" : 0,
"errmsg" : "TTL indexes are single-field indexes, compound indexes do not support TTL. Index spec: { key: { createdAt: 1.0, text: 1.0 }, name: \"createdAt_1_text_1\", expireAfterSeconds: 86400.0 }",
"code" : 67,
"codeName" : "CannotCreateIndex",
"$clusterTime" : {
"clusterTime" : Timestamp(1599925286, 1),
"signature" : {
"hash" : BinData(0,"mCmm0gKiYCSNIpYEggT3LloGKdw="),
"keyId" : NumberLong("6848960729458933762")
}
}
}
Annoying Anaconda