我有以下$ let表达式:
{
"$let": {
"vars": {
"h": {
"$hour": "$Date"
}
},
"in": {
"$cond": {
"if": {
"$lt": [
"$$h",
6
]
},
"then": "Night",
"else": {
"$cond": {
"if": {
"$lt": [
"$$h",
12
]
},
"then": "Morning",
"else": {
"$cond": {
"if": {
"$lt": [
"$$h",
18
]
},
"then": "Afternoon",
"else": "Evening"
}
}
}
}
}
}
}
}
我无法找到将此shell操作转换为Java驱动程序版本的任何方法。我尝试了MongoDB java驱动程序文档甚至Google,但无法找到任何方法。
任何可能是JAVA实现的帮助。
提前谢谢!!!