Hi Phani
I would like to use 14691,14692 as my primary keys or unique identifiers rather than using objectid as a unique identifier.
I’m not certain I understand your requirement. The _id
can be thought of as a primary key of the document, and it must be unique across the collection, even if the collection is spread across multiple servers (via sharding). However, you posted a single JSON document containing two keys, each containing a large set of values. What is your use case, and how do you plan to use your data?
Please note that MongoDB schema design generally encourages you to create your schema according to your use case, as opposed to according to how the data will be stored (i.e. normal forms in relational databases). You might find the following links helpful with regard to MongoDB schema design in general:
If you just started with MongoDB, please note that we have an extensive collection of free courses available in the MongoDB University. You may find the, M001: MongoDB Basics, and M101P: MongoDB for Developers courses beneficial.
Best regards,
Kevin