目前,文档如下所示:
{
"_id": {
"$oid": "630f3c32c1a580642a9ff4a0"
},
"title": "This is a title",
"slug": "this-is-a-title",
"Post": "this is a post"
}
但我希望是这样的:
{
"_id": {
"$oid": "630f3c32c1a580642a9ff4a0"
},
"title": "This is a title",
"slug": "this-is-a-title-548631",
"Post": "this is a post"
}
如何在所有文档中的Slug结尾处添加6位随机数?