mongoDB : multi value field search ignoring null fields
问题 I am trying to make a search on several field where some of them can be left blank. Given the following Json document in MongoDB (only three fields here, but N fields in reality, with N > 10) : { 'first_name' : 'value_X', 'last_name' : 'value_Y', 'mail_adress' : 'value_Z' } Then let's suppose a form where the user can enter the value of the first name, last name, mail address and phone number. If all the field are filled the query in MongoDB looks like : db.collection.find( { 'first_name' :