Hi Pavel,
Thanks for describing in more details for my needs. Basically, looking for the option for atlas search based on some aggregated queries which is not structure in documents, likewise NLP does.
Please find below fruit collection that have structured source and data key which consist of fruit suppliers in the country.
[
{
"_id": "5bfd1...",
"source": "Citrus",
"data": {
"name": "Orange",
"color": "Orange",
"suppliers": {
"name": "Punjab"
},
"quantity": "6T"
}
},
{
"_id": "5bfd2...",
"source": "Citrus",
"data": {
"name": "limes",
"color": "Yellow",
"suppliers": {
"name": "Gujarat"
},
"quantity": "5T"
}
},
{
"_id": "5bfd3...",
"source": "Citrus",
"data": {
"name": "limes",
"color": "Green",
"suppliers": {
"name": "Gujarat",
"zone": "North",
"cities": [
"A",
"B",
"C"
]
},
"quantity": "5T"
}
},
{
"_id": "5bfd4...",
"source": "Tropical",
"data": {
"name": "bananas",
"color": "Yellow",
"suppliers": {
"name": "Maharashtra",
"zone": "NorthEast",
"vendor": {
"vendorname": "Villare"
}
},
"quantity": "5T"
}
},
{
"_id": "5bfd5...",
"source": "Tropical",
"data": {
"name": "bananas",
"color": "Yellow",
"suppliers": {
"name": "Maharashtra",
"zone": "South",
"vendor": {
"vendorname": "Robb"
}
},
"quantity": "5T"
}
},
{
"_id": "5bfd6...",
"source": "Berries",
"data": {
"name": "kiwifruit",
"color": "Green",
"suppliers": {
"name": "TamilNadu",
"zone": "South",
"vendor": {
"vendorname": "Tamil",
"resides": ["Chennai","Thiruchi"],
"transport": {
"motor": "Truck",
"ferry": "Boat"
}
}
},
"quantity": "5T"
}
}
]
I may want to query that in following ways,
1 Find the berries which supplied by boat in Chennai.
2 Suppliers who supply fruit from Gujarat
3 Find fruit which have 5T quantity supply
…etc
In above 3rd query, we know that in data field have “quantity” node which then find out or match by value 5T.
In 2nd we only know about the name of supplier but we doesn’t know in which name of fields in document it will belongs to also the same in 1st one where boat is in nested object and we only know the value “boat” , “berries” and “Chennai”. Here I faced problem if unstructure field or value is in incoming request how it will be used to query by only text or conditional text statements.
Thanks.