Guest User

Untitled

a guest
Jan 21st, 2018
320
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. fields = ['first-name', 'last-name', 'email-address', 'phone-number']
  2. values = ['John', 'Doe', 'john.doe@johndoe.com', '1-800-123-4567']
  3.  
  4. {
  5. 'first-name':'John',
  6. 'last-name':'Doe',
  7. 'email':'john.doe@johndoe.com',
  8. 'phone-number':'1-800-123-4567'
  9. }
  10.  
  11. def getFirstName(self, lastname):
  12. client = MongoClient()
  13. db = client.test.contacts
  14. result db.find({ 'last-name':lastname })
  15. return result['first-name']
  16.  
  17. self.getFirstName("Doe")
Add Comment
Please, Sign In to add comment