Below are the documents like:
{
"name": "Micheal",
"title": "appliaction engeneer",
"age": 30,
"interest": "java",
"manager": "Amily"
},
{
"name": "Georgiana",
"title": "appliaction engeneer",
"age": 34,
"interest": "java",
"manager": "Amily"
},
{
"name": "Benjamin",
"title": "Product Manager",
"age": 36,
"interest": "management",
"manager": "robinson "
},
{
"name": "Selina",
"title": "appliaction engeneer",
"age": 30,
"interest": "java",
"manager": "Grey "
},
{
"name": "Edison",
"title": "appliaction engeneer",
"age": 26,
"interest": ".net",
"manager": "Amily "
}
Now I need to exact three fields title, age, interest
from the documents.
The results should be like:
{
"title": "appliaction engeneer",
"age": 30,
"interest": "java",
},
{
"title": "appliaction engeneer",
"age": 34,
"interest": "java",
},
{
"title": "Product Manager",
"age": 36,
"interest": "management",
},
{
"title": "appliaction engeneer",
"age": 26,
"interest": ".net",
}
One of the repeated record like below one should be removed.
{
"title": "appliaction engeneer",
"age": 30,
"interest": "java"
}
And most importantly, the order of the obtained records should be consistent with the documents.
How can we achieve this?