我有一个 mongo 集合。现在,用户可以根据需要使用任何字段或所有字段进行搜索。
例如:- 用户可以使用任何一个属性或任何两个属性或他记得的集合中存在的字段的任意数量的属性进行搜索。帮助我决定应该使用哪个运算符或运算符组合?
{"_id":1, "field1":"hi","field2":"bye","field3":"bro", "field4":"stuff"},
{"_id":2, "field1": "hello", "field2": "back", "field3": "fat", "field4":"cat"},
{"_id":3, "field1": "some", "random": "foo", "stuff": "bar", "field4":"help"}
Run Code Online (Sandbox Code Playgroud)