I would like to make a query in Mongo through the Python Shell
query2 = (
{
"itemId":{"$in": List},
"startDate" : {"$gt": start_date}
},
{"a":1, 'b':1, 'startDate':1}
)
List has this format
[u'abcd1',
u'abcd2',
u'abcd3']
Pb: It returns 0
I guess it's because in my Mongo DB the itemId has this format :
ObjectId("abcd1")
Tried this
portsList = map(lambda x: "ObjectId('" + x +"')", portsList)
But it won't work