0
coming_monday = today + datetime.timedelta(days=-today.weekday(), weeks=1)
month = coming_monday.strftime("%B")
collection = db['empmain']
record = collection.find_one({'Availablity.<want to pass in the month variable here'})

format of the collection: enter image description here

petezurich
  • 9,280
  • 9
  • 43
  • 57

1 Answers1

0

This example worked for me:

a = 1
b = 2
c = 3
mydict = {a : "a_", b : "b_", c : "c_"}

I've declard some variables with some values as above.

>>> mydict[1]
'a_'
>>> mydict[b]
'b_'

I was able to access values in the dictionary using both the variable names or the values.

ChocolateOverflow
  • 460
  • 1
  • 4
  • 11