Good day. It is necessary to find all the people who graduated, for example, Institute 567. The problem is that we can not accurately specify the parent elements for this institution (and are at different levels). For example, in the professions.actor. theatre.drama and in professions.actor. stuntman is an institute
{ "_id": ObjectId("56ff619b14989a0ed0316921"), "firstName": "Иван", "lastName": "Лабанов", "professions": { "actor": { "film": { "drama": { "institute": 567 }, }, "theatre": { "drama": { "institute": 123, }, }, "stuntman": { "institute": 321, } }, } }, { "_id": ObjectId("56fe77b114989a05577e9f22"), "firstName": "Петр", "lastName": "Смирнов", "professions": { "actor": { "film": { "comedy": { "institute": 567, } }, } } }, { "_id": ObjectId("56fe77b114989a05577e9f11"), "firstName": "Василий", "lastName": "Иванов", "professions": { "actor": { "film": { "comedy": { "institute": 123, } }, } } }
We chose a non-relational precisely because the data is structured, but it has an nesting, which Monga does a great job with. The essence of the task - we have a lot of people of creative professions (and others with them): Actors, Voice, Models, Maykapery. Each of these professions has many areas (theater actor, film actor, circus actors, stuntmen), these areas may have specific specializations (opera and ballet theater, comedy film actor, etc.), and so even a few levels of nesting (education, knowledge of languages, etc.). The difficulty is not just in storage, but in that it is possible to search by these parameters. Here is a real example query:
A man above 180cm, up to 25 years old, a category C driving license, graduated from VGIK, opera soloist (Italian), able to juggle.