title: Impossible to pass a variable in key return in MongoDB or NoSQL DB?
body: <p>Here's my code: </p>
  
  <pre><code>    dob = 1
      email = 1
      nationality = 1
      work = 1
      situation = 1
      skype = 1
      user_id = ObjectId(self.get_argument("id"))
      contact_id = ObjectId(self.get_argument("contactId"))
      contact_confidentiality = db.cara.users.find_one({"_id" : contact_id}, {"profil.private.confidential" : 1})
      confidentiality = []
      for i in contact_confidentiality["profil"]["private"]["confidential"]:
        if i == "dob":
      dob = 0
        elif i == "email":
      email = 0
        elif i == "nationality":
      nationality = 0
        elif i == "work":
      work = 0
        elif i == "situation":
      situation = 0
        elif i == "skype":
      skype = 0
        elif i == "facebook":
      facebook = 0
  
  contact = db.cara.users.find_one({"_id" : contact_id}, {"profil.private.first_name": 1, "profil.private.last_name": 1, "profil.gender": 1, "profil.dob": dob, "profil.nationality": nationality, "profil.work": work, "profil.private.email_address": email, "profil.private.situation": situation, "profil.private.skype": skype})
  </code></pre>
  
  <p>MongoDB doesn't want to pass in the last line of my code: dob, nationality, work, email. How can I pass variable?</p>
  
  <p>EDIT:</p>
  
  <pre><code> contact_confidentiality = db.cara.users.find_one({"_id" : contact_id}, {"profil.private.confidential" : 1})
  
  projection = {
      'profil.private.first_name' :1 ,
      'profil.private.last_name' : 1,
      'profil.gender' : 1,
      'profil.dob' : 1,
      'profil.private.email_address' : 1,
      'profil.nationality' : 1,
      'profil.work' : 1,
      'profil.private.situation' : 1,
      'profil.private.skype' : 1,
      'profil.facebook' : 1
    } 
  
  
  for i in contact_confidentiality["profil"]["private"]["confidential"]:
    i_json = self._doc_to_json(i)
    logging.info(i_json)
    del projection[i_json] # I need a key like "profil.nationality" but my key is "nationality"
  
  
  contact = db.cara.users.find_one({"_id" : contact_id}, projection)
  </code></pre>