How to force mongo db $or query to check for first provided value first and fall only back to second if not found?

前端 未结 0 1334
抹茶落季
抹茶落季 2020-12-03 19:12

Let\'s say I have a mongo db with the following documents in a collection:

{\'foo\' : 1, \'bar\' : \'asd\'}
{\'foo\' : 2, \'bar\' : \'some-existing-name\'}
..         


        
相关标签:
回答
  • 消灭零回复
提交回复
热议问题