> db.createCollection("ts", {timeseries: {timeField: "t", metaField: "tag"}});
{ "ok" : 1 }
> db.ts.insert({t: new ISODate(), tag: 1, f: 1});
WriteResult({ "nInserted" : 1 })
> db.ts.createIndex({tag: 1});
{
"numIndexesBefore" : 1,
"numIndexesAfter" : 2,
"createdCollectionAutomatically" : false,
"ok" : 1
}
> db.ts.getIndexes();
[
{
"v" : 2,
"key" : {
"tag" : 1,
"t" : 1
},
"name" : "tag_1_t_1"
},
{
"v" : 2,
"key" : {
"tag" : 1
},
"name" : "tag_1"
}
]
> db.ts.deleteMany({tag: 1, f: 1});
{ "acknowledged" : true, "deletedCount" : 0 }
> db.ts.dropIndex("tag_1");
{ "nIndexesWas" : 2, "ok" : 1 }
> db.ts.deleteMany({tag: 1, f: 1});
{ "acknowledged" : true, "deletedCount" : 1 }