'Mongodb primary key on ASP.NET Core

I have an ASP.NET Core project, currently testing CRUD, the database is using Mongodb. After watching the tutorial to try to do it once, I found that the ID in the database and the ID in the category I set each generated a set of IDs, from the DB structure, the ID I set in the type is treated as general data.

The main purpose may be the index used when calling the database of web pages (my guess), so would you like to ask, is it possible that these two sets of IDs will be integrated into one?

enter image description here


enter image description here

enter image description here



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source