- now the condition is that a List, such as type ["sh", "th"] / / is not the full value in the database type, but only has a prefix .
- according to this query, the following database shows that type contains sh and th prefixes, and the whole document
- the result should be 1, 2, 4 record (document) should be detected
- how to implement it, it"s best to use springdata mongdb, or other java methods
for example, the database has three record entries as follows:
{
"_id": "5bcfe3367f0xxxxx02",
"type": [
"sh-adidas",
"th-NB"
],
"status": "active",
"lastUpdateDate": "2018-10-25T17:27:41+08:00"
}
{
"_id": "5bcfe3367f0xxxxx02",
"type": [
"bj-nike",
"sh-adidas"
],
"status": "active",
"lastUpdateDate": "2018-10-25T17:27:41+08:00"
}
{
"_id": "5bcfe3367f0xxxxx02",
"type": [
"bj-nike"
],
"status": "active",
"lastUpdateDate": "2018-10-25T17:27:41+08:00"
}
{
"_id": "5bcfe3367f0xxxxx02",
"type": [
"bj-nike",
"sh-adidas",
"th-NB",
"th-vans"
],
"status": "active",
"lastUpdateDate": "2018-10-25T17:27:41+08:00"
}